Skip to content

[E][ssl_client.cpp:33] _handle_error(): [send_ssl_data():284]: (-80) UNKNOWN ERROR CODE (0050) #649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TadasPik opened this issue Oct 20, 2021 · 6 comments

Comments

@TadasPik
Copy link

Hello. With WiFiClientSecure implementation, random error (no exact time or count of requests available) appears and crashes esp32
[E][ssl_client.cpp:33] _handle_error(): [send_ssl_data():284]: (-80) UNKNOWN ERROR CODE (0050)

Using latest versions of platformio core and esp32-arduino frameworks.

It looks like the issue was solved in wificlientsecure lib v2, yet its not available nor stable (tested witf platform_packages =
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git - project doesnt build).

Maybe it would be possible to somehow integrate this change in current supported lib?

@MaxSvjatoha
Copy link

Same problem here. Any solution in sight? Sample error logs:

--- forcing RTS inactive
--- Miniterm on COM8 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
mounted SPIFFs
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 2 - STA_START
connecting to WiFi
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
Wifi signal strength:-59
waiting on time sync...
[I][ArduinoOTA.cpp:141] begin(): OTA server at: esp32-c8c9a3f99278.local:3232
Local IP: 192.168.0.200
Camera init succeeded
reboot time set up
checking wifi...

Connecting...
refreshing JWT
[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 93004
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[V][ssl_client.cpp:129] start_ssl_client(): Loading CA cert
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 53680
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 337 bytes...
connected

Library connected!
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 41 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 45 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 46 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 73 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 59 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 116 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 116 bytes...
[V][ssl_client.cpp:300] send_ssl_data(): Handling error -80
[E][ssl_client.cpp:36] _handle_error(): [send_ssl_data():301]: (-80) UNKNOWN ERROR CODE (0050)
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
checking wifi...

Connecting...
refreshing JWT
[V][ssl_client.cpp:59] start_ssl_client(): Free internal heap before TLS 93088
[V][ssl_client.cpp:65] start_ssl_client(): Starting socket
[V][ssl_client.cpp:104] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:113] start_ssl_client(): Setting up the SSL/TLS structure...
[V][ssl_client.cpp:129] start_ssl_client(): Loading CA cert
[V][ssl_client.cpp:197] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:212] start_ssl_client(): Performing the SSL/TLS handshake...
[V][ssl_client.cpp:233] start_ssl_client(): Verifying peer X.509 certificate...
[V][ssl_client.cpp:242] start_ssl_client(): Certificate verified.
[V][ssl_client.cpp:257] start_ssl_client(): Free internal heap after TLS 54120
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 337 bytes...
connected

Library connected!
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 41 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 45 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 46 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 73 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 116 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 59 bytes...
saved new config
reboot time set up
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 4 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 116 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 116 bytes...
[V][ssl_client.cpp:295] send_ssl_data(): Writing HTTP request with 116 bytes...
[V][ssl_client.cpp:300] send_ssl_data(): Handling error -80
[E][ssl_client.cpp:36] _handle_error(): [send_ssl_data():301]: (-80) UNKNOWN ERROR CODE (0050)
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:265] stop_ssl_socket(): Cleaning SSL connection.

@TadasPik
Copy link
Author

Not that i know of, and it seems more like a random crash

@valeros
Copy link
Member

valeros commented May 4, 2022

Should be fixed in the latest version of the development platform that uses Arduino v2.0.2, please update your packages via pio update . Feel free to reopen the issue if the problem persists.

@Tarik2142
Copy link

I found that client->println() throws an error (-80) UNKNOWN ERROR CODE (0050) at some point
I replaced it with client->print(boundary + "\r\n"); and everything started working

@n1lby73
Copy link

n1lby73 commented Jul 13, 2023

I found that client->println() throws an error (-80) UNKNOWN ERROR CODE (0050) at some point I replaced it with client->print(boundary + "\r\n"); and everything started working

kindly give more details about this. this is how i use client.println

    client.println("POST /synchardchanges HTTP/1.1");
    client.println("Host: industrialiot.onrender.com");
    client.println("Content-Type: application/json");

and sometimes i also get this error
[154302][E][ssl_client.cpp:37] _handle_error(): [send_ssl_data():382]: (-27136) SSL - A buffer is too small to receive or write a message

@Tarik2142
Copy link

I found that client->println() throws an error (-80) UNKNOWN ERROR CODE (0050) at some point I replaced it with client->print(boundary + "\r\n"); and everything started working

kindly give more details about this. this is how i use client.println

    client.println("POST /synchardchanges HTTP/1.1");
    client.println("Host: industrialiot.onrender.com");
    client.println("Content-Type: application/json");

and sometimes i also get this error [154302][E][ssl_client.cpp:37] _handle_error(): [send_ssl_data():382]: (-27136) SSL - A buffer is too small to receive or write a message

You and I have different errors, but you can try to replace println, for example:

client.print("POST /synchardchanges HTTP/1.1");
client.print("\r\n");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants