esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00

akash kadam
Posts: 2
Joined: Wed Jul 31, 2024 6:02 am

esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00

Postby akash kadam » Wed Jul 31, 2024 6:09 am

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

ESP_harshal
Posts: 24
Joined: Wed Jul 06, 2022 8:36 am

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

Postby ESP_harshal » Tue Aug 06, 2024 4:05 am

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!

akash kadam
Posts: 2
Joined: Wed Jul 31, 2024 6:02 am

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

Postby akash kadam » Wed Aug 14, 2024 7:44 am

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);"

Who is online

Users browsing this forum: No registered users and 162 guests