|
@@ -449,7 +449,7 @@ esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls_cfg_t
|
|
|
|
|
|
|
|
if (cfg->alpn_protos) {
|
|
if (cfg->alpn_protos) {
|
|
|
#ifdef CONFIG_MBEDTLS_SSL_ALPN
|
|
#ifdef CONFIG_MBEDTLS_SSL_ALPN
|
|
|
- if ((ret = mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos) != 0)) {
|
|
|
|
|
|
|
+ if ((ret = mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos)) != 0) {
|
|
|
ESP_LOGE(TAG, "mbedtls_ssl_conf_alpn_protocols returned -0x%x", -ret);
|
|
ESP_LOGE(TAG, "mbedtls_ssl_conf_alpn_protocols returned -0x%x", -ret);
|
|
|
ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_MBEDTLS, -ret);
|
|
ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_MBEDTLS, -ret);
|
|
|
return ESP_ERR_MBEDTLS_SSL_CONF_ALPN_PROTOCOLS_FAILED;
|
|
return ESP_ERR_MBEDTLS_SSL_CONF_ALPN_PROTOCOLS_FAILED;
|
|
@@ -625,6 +625,10 @@ esp_err_t esp_mbedtls_init_global_ca_store(void)
|
|
|
|
|
|
|
|
esp_err_t esp_mbedtls_set_global_ca_store(const unsigned char *cacert_pem_buf, const unsigned int cacert_pem_bytes)
|
|
esp_err_t esp_mbedtls_set_global_ca_store(const unsigned char *cacert_pem_buf, const unsigned int cacert_pem_bytes)
|
|
|
{
|
|
{
|
|
|
|
|
+#ifdef CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT
|
|
|
|
|
+ ESP_LOGE(TAG, "Please disable dynamic freeing of ca cert in mbedtls (CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT)\n in order to use the global ca_store");
|
|
|
|
|
+ return ESP_FAIL;
|
|
|
|
|
+#endif
|
|
|
if (cacert_pem_buf == NULL) {
|
|
if (cacert_pem_buf == NULL) {
|
|
|
ESP_LOGE(TAG, "cacert_pem_buf is null");
|
|
ESP_LOGE(TAG, "cacert_pem_buf is null");
|
|
|
return ESP_ERR_INVALID_ARG;
|
|
return ESP_ERR_INVALID_ARG;
|