Closed TimothyFran closed 1 month ago
The SSL Client (NetworkClientSecure
) was defined in your code and it's not a part of library.
The issue is in SSL Client itself.
Your device free heap is not enough for SSL Client to work for TLS handshake.
[ 26846][E][ssl_client.cpp:36] _handle_error(): [ssl_starttls_handshake():313]: (-29312) SSL - The connection indicated an EOF
Can I disable the TLS?
For what? It is the nowadays standard for secure server connection.
Do you have any advice to solve this problem?
You have to reduce your memory usage.
You can't use many libraries simultaneously.
Greetings,
I'm stuck at this same error for about 2 days now. I'm using the espressif-idf platform (esp-idf v5.1.3) while using Arduino as a component (arduino-esp32 v3.x.x). I have the esp32s3 module with 8mb PSRAM. I had encounter a similar error while using a network library that was short on memory (free heap) required for SSL Client to work for TLS handshake. The fix I used was to enable mbedTLS memory allocation strategy to use PSRAM in menuConfig.
I tried running the storage download example (FirebaseClient\examples\Storage\Async\Callback\Download\Download.ino) before encountering this error. I suspect this error stems from using an invalid socket descriptor. We may be required ensure sockets are properly created, initialized, and managed throughout the code. I previously had the deprecated Firebase-ESP-Client library running with no errors until I decided to migrate to this streamlined FirebaseClient library.
A reassessment of this error may be required.
Thanks for the support.
The old Firebase library used internal SSL Client called ESP_SSLClient instead of WiFiClientSecure or NetworkClientSecure.
With new FirebaseClient library, the SSL Client is user defined object which is not a part of library.
You should read the library documentation in case you want to use ESP_SSLClient which its memory can be allocated in internal Heap or in PSRAM.
Large memory allocation (approx 37k) in ESP32's WiFiClientSecure (now NetworkClientSecure) is not new and user need to mange the memory usage when use it carefully.
Thanks for the swift response.
I attempted using the ESP_SSLClient as described in the documentation. I still couldn't get a headway. I get the following error at runtime:
Event task: authTask, msg: authenticating, code: 7 Debug task: authTask, msg: Connecting to server... Event task: authTask, msg: auth request sent, code: 8 Event task: authTask, msg: error, code: -1 Debug task: authTask, msg: Terminating the server connection...
I'll try troubleshooting a few more times, if no breakthrough, I guess I'll just revert back to the old library - Firebase-ESP-Client.
The error is because you don't use the ESP_SSLClient correctly as it was a part of old Firebase library.
You should read the documentation thoroughly. The documentation will point you to the Stream concurrency examples which you have to follow for how to setup ESP_SSLClient correctly.
it is up to you to use any library included deprecated Firebase library.
Describe the bug When using any example code with ESP32 I get many setSocketOption() errors in the log. The requests (expecially authentication) fails many time before to succeed.
To Reproduce Use any Async example sketch
Expected behavior The request should succeed immediately without this error
Logs
PlatformIO configuration:
Additional context The problem occurs even using the Arduino IDE