Page 1 of 1

esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00

Posted: Wed Jul 31, 2024 6:09 am
by akash kadam
I am having this following error when accessing https URL

E (128542) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00
I (128543) esp-tls-mbedtls: Certificate verified.
E (128544) esp-tls: Failed to open new connection
E (128549) transport_base: Failed to open a new connection
E (128559) HTTP_CLIENT: Connection failed, sock < 0
E (128561) HTTP_CLIENT: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT

this is the config
esp_http_client_config_t config_get_api =
{
.url=URL,
.transport_type = HTTP_TRANSPORT_OVER_SSL,
.cert_pem = esp_crt_bundle_attach,
};

Is it because the method I used to create CA certificate is wrong , then what is the correct one and/or there are other parameters that I have to set in code to make it work for https. with CA certificate.
Thank You

Re: esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00

Posted: Tue Aug 06, 2024 4:05 am
by ESP_harshal
Hi @askash kadam,

I think you should use the

Code: Select all

.crt_bundle_attach
element for the config to attach the cert bundle instead of

Code: Select all

.cert_pem
. The

Code: Select all

.cert_pem
element expects a certificate string whereas

Code: Select all

.crt_bundle_attach
expects a callback function pointer.

Thank you!

Re: esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00

Posted: Wed Aug 14, 2024 7:44 am
by akash kadam
This issue is resolved.
Thank you for suggestion ESP_harshal it helped with CA Certificate configurate later, I used dedicated PEM Certificate at end.

Also the main issue here was because of wrong callback that was registered with "mbedtls_ssl_send_t *MBEDTLS_PRIVATE(f_send);"