mbedtls_ssl_setup returned -0x7f00

emreimrn
Posts: 1
Joined: Sun Apr 07, 2019 8:23 pm

mbedtls_ssl_setup returned -0x7f00

Postby emreimrn » Sun Apr 07, 2019 8:31 pm

Hi, I'm using MQTT Secure HTTPS TLS/SSL WebSocket ThingSpeak Publish Example.
https://github.com/pcbreflux/espressif/ ... re_publish

I have see a error when the send end of the every fifth message that as below until the reboot.

MQTTmbedtls: mbedtls_ssl_setup returned -0x7f00

How can I fix this error? Please, could you help me?
thanks.

ESP_cermak
Posts: 69
Joined: Thu Nov 01, 2018 8:32 am

Re: mbedtls_ssl_setup returned -0x7f00

Postby ESP_cermak » Mon Apr 08, 2019 12:39 pm

Hi,

This return code means `MBEDTLS_ERR_SSL_ALLOC_FAILED`, so mbedtls failed to malloc some data.
You may want to printf available heap size with `esp_get_free_heap_size()`.

hallgrim
Posts: 4
Joined: Fri Nov 30, 2018 10:35 am

Re: mbedtls_ssl_setup returned -0x7f00

Postby hallgrim » Mon Mar 02, 2020 7:19 pm

Maybe you forgot to call esp_http_client_cleanup? Or maybe you are calling esp_http_client_init more than once?

Amrita
Posts: 1
Joined: Fri Nov 16, 2018 7:14 am

Re: mbedtls_ssl_setup returned -0x7f00

Postby Amrita » Thu Sep 10, 2020 2:31 pm

I have similar issue. but it occurs randomly. I am using websocket_client and have the example from esp idf
esp-idf version: 4.0.1
Following is the log.
08:24:02.081 -> [ws_eventHandler]WEBSOCKET_EVENT_DISCONNECTED
08:24:02.081 -> [ws_eventHandler]WEBSOCKET_EVENT_DISCONNECTED
08:24:02.721 -> [ws_eventHandler]WEBSOCKET_EVENT_DATA: 0[0;31mE (548192989) esp-tls: mbedtls_ssl_setup returned -0x7f00[0m
08:24:02.721 -> [0;31mE (548192989) esp-tls: mbedtls_ssl_setup returned -0x7f00[0m
08:24:02.721 -> [0;31mE (548192989) esp-tls: create_ssl_handle failed[0m
08:24:02.721 -> [0;31mE (548192999) esp-tls: create_ssl_handle failed[0m
08:24:02.721 -> [0;31mE (548192999) esp-tls: Failed to open new connection[0m
08:24:02.721 -> [0;31mE (548193009) esp-tls: Failed to open new connection[0m
08:24:02.721 -> [0;31mE (548193019) TRANS_SSL: Failed to open a new connection[0m
08:24:02.721 -> [0;31mE (548193019) TRANS_SSL: Failed to open a new connection[0m
08:24:02.761 -> [0;31mE (548193029) TRANSPORT_WS: Error connecting to host [0m
08:24:02.761 -> [0;31mE (548193039) WEBSOCKET_CLIENT: Error transport connect[0m
08:24:02.761 -> [0;31mE (548193059) WEBSOCKET_CLIENT: Error transport connect[0m
08:24:02.761 -> [ws_eventHandler]WEBSOCKET_EVENT_DISCONNECTED
08:24:12.113 -> [ws_eventHandler]WEBSOCKET_EVENT_DATA: 1
08:24:12.113 -> [ws_eventHandler]PING
08:24:12.389 -> [ws_eventHandler]PONG[0;31mE (548202689) esp-tls: mbedtls_ssl_setup returned -0x7f00[0m
08:24:12.389 -> [0;31mE (548202689) esp-tls: create_ssl_handle failed[0m
08:24:12.389 -> [0;31mE (548202699) esp-tls: Failed to open new connection[0m
08:24:12.389 -> [0;31mE (548202699) TRANS_SSL: Failed to open a new connection[0m
08:24:12.389 -> [0;31mE (548202709) TRANSPORT_WS: Error connecting to host [0m
08:24:12.389 -> [0;31mE (548202719) WEBSOCKET_CLIENT: Error transport connect[0m
08:24:12.389 ->
08:24:12.428 -> [ws_eventHandler]WEBSOCKET_EVENT_DISCONNECTED
08:24:12.508 -> [0;31mE (548202779) esp-tls: mbedtls_ssl_setup returned -0x7f00[0m
08:24:12.508 -> [0;31mE (548202779) esp-tls: create_ssl_handle failed[0m
08:24:12.508 -> [0;31mE (548202779) esp-tls: Failed to open new connection[0m
08:24:12.508 -> [0;31mE (548202789) TRANS_SSL: Failed to open a new connection[0m
08:24:12.508 -> [0;31mE (548202789) TRANSPORT_WS: Error connecting to host [0m
08:24:12.508 -> [0;31mE (548202799) WEBSOCKET_CLIENT: Error transport connect[0m

The strange thing is 'WEBSOCKET_EVENT_DATA' event is happening despite it's not connected to server.
Notice that there is no 'WEBSOCKET_EVENT_CONNECTED' log

chuledeco
Posts: 7
Joined: Thu Feb 13, 2020 3:22 pm

Re: mbedtls_ssl_setup returned -0x7f00

Postby chuledeco » Sat Aug 12, 2023 3:07 pm

I have the same issue, but using web server. It randomly works fine, or answer:
I (18415) esp_https_server: performing session handshake
E (19875) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7780
E (19875) esp_https_server: esp_tls_create_server_session failed
E (19875) httpd: httpd_accept_conn: session creation failed
W (19885) httpd: httpd_server: error accepting new connection

Who is online

Users browsing this forum: No registered users and 136 guests