mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-14 02:56:33 +02:00
feat(websocket): allow users to attach CA bundle
with esp_transport_ssl_crt_bundle_attach(), it is not necessary to include a specific certificate. other protocol clients, such as esp_http_client, do the same. fixes #48
This commit is contained in:
@ -392,6 +392,15 @@ esp_websocket_client_handle_t esp_websocket_client_init(const esp_websocket_clie
|
||||
esp_transport_ssl_set_client_key_data_der(ssl, config->client_key, config->client_key_len);
|
||||
}
|
||||
}
|
||||
|
||||
if (config->crt_bundle_attach) {
|
||||
#ifdef CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
|
||||
esp_transport_ssl_crt_bundle_attach(ssl, config->crt_bundle_attach);
|
||||
#else //CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
|
||||
ESP_LOGE(TAG, "crt_bundle_attach configured but not enabled in menuconfig: Please enable MBEDTLS_CERTIFICATE_BUNDLE option");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (config->skip_cert_common_name_check) {
|
||||
esp_transport_ssl_skip_common_name_check(ssl);
|
||||
}
|
||||
|
Reference in New Issue
Block a user