mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 18:10:57 +02:00
fix(esp-tls): removed unncessary log for certificate verification
This commit removed unnecessary and confusing log for certificate verify if there is another issue during tls connection.
This commit is contained in:
@@ -310,8 +310,12 @@ int esp_mbedtls_handshake(esp_tls_t *tls, const esp_tls_cfg_t *cfg)
|
|||||||
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);
|
||||||
ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_ESP, ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED);
|
ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_ESP, ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED);
|
||||||
if (cfg->crt_bundle_attach != NULL || cfg->cacert_buf != NULL || cfg->use_global_ca_store == true) {
|
if (cfg->crt_bundle_attach != NULL || cfg->cacert_buf != NULL || cfg->use_global_ca_store == true) {
|
||||||
/* This is to check whether handshake failed due to invalid certificate*/
|
if (mbedtls_ssl_get_peer_cert(&tls->ssl) != NULL) {
|
||||||
esp_mbedtls_verify_certificate(tls);
|
/* This is to check whether handshake failed due to invalid certificate*/
|
||||||
|
esp_mbedtls_verify_certificate(tls);
|
||||||
|
} else {
|
||||||
|
ESP_LOGD(TAG, "Skipping certificate verification - no peer certificate received");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tls->conn_state = ESP_TLS_FAIL;
|
tls->conn_state = ESP_TLS_FAIL;
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user