mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'fix/esp_tls_add_warning_if_ca_chain_has_invalid_cert_v3.3' into 'release/v3.3'
esp_tls: Add warning if the CA chain provided contains one/more invalid cert See merge request espressif/esp-idf!11942
This commit is contained in:
commit
5713bb1bb8
@ -292,6 +292,11 @@ static int create_ssl_handle(esp_tls_t *tls, const char *hostname, size_t hostle
|
|||||||
ESP_LOGE(TAG, "mbedtls_x509_crt_parse returned -0x%x\n\n", -ret);
|
ESP_LOGE(TAG, "mbedtls_x509_crt_parse returned -0x%x\n\n", -ret);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
if (ret > 0) {
|
||||||
|
/* This will happen if the CA chain contains one or more invalid certs, going ahead as the hadshake
|
||||||
|
* may still succeed if the other certificates in the CA chain are enough for the authentication */
|
||||||
|
ESP_LOGW(TAG, "mbedtls_x509_crt_parse was partly successful. No. of failed certificates: %d", ret);
|
||||||
|
}
|
||||||
mbedtls_ssl_conf_authmode(&tls->conf, MBEDTLS_SSL_VERIFY_REQUIRED);
|
mbedtls_ssl_conf_authmode(&tls->conf, MBEDTLS_SSL_VERIFY_REQUIRED);
|
||||||
mbedtls_ssl_conf_ca_chain(&tls->conf, tls->cacert_ptr, NULL);
|
mbedtls_ssl_conf_ca_chain(&tls->conf, tls->cacert_ptr, NULL);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user