fix(esp-tls): capture errors in error handle

This commit is contained in:
Harshit Malpani 2024-01-03 16:51:00 +05:30
parent 07980dba2f
commit 9274e3e620
No known key found for this signature in database
GPG Key ID: 441A8ACC7853D493

View File

@ -926,6 +926,8 @@ int esp_mbedtls_server_session_create(esp_tls_cfg_server_t *cfg, int sockfd, esp
if (ret != ESP_TLS_ERR_SSL_WANT_READ && ret != ESP_TLS_ERR_SSL_WANT_WRITE) {
ESP_LOGE(TAG, "mbedtls_ssl_handshake returned -0x%04X", -ret);
mbedtls_print_error_msg(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);
tls->conn_state = ESP_TLS_FAIL;
return ret;
}