Page 1 of 1

mbedtls_ssl_setup returned -0x7f00

Posted: Sun Apr 07, 2019 8:31 pm
by emreimrn
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.

Re: mbedtls_ssl_setup returned -0x7f00

Posted: Mon Apr 08, 2019 12:39 pm
by ESP_cermak
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()`.

Re: mbedtls_ssl_setup returned -0x7f00

Posted: Mon Mar 02, 2020 7:19 pm
by hallgrim
Maybe you forgot to call esp_http_client_cleanup? Or maybe you are calling esp_http_client_init more than once?

Re: mbedtls_ssl_setup returned -0x7f00

Posted: Thu Sep 10, 2020 2:31 pm
by Amrita
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

Re: mbedtls_ssl_setup returned -0x7f00

Posted: Sat Aug 12, 2023 3:07 pm
by chuledeco
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