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:
nilesh.kale
2025-08-14 14:06:40 +05:30
committed by Nilesh Kale
parent 421b9abd0d
commit 54d97fdac1

View File

@@ -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) {
if (mbedtls_ssl_get_peer_cert(&tls->ssl) != NULL) {
/* This is to check whether handshake failed due to invalid certificate*/ /* This is to check whether handshake failed due to invalid certificate*/
esp_mbedtls_verify_certificate(tls); 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;