You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Customized to add Ethernet, up to date with main NF_interpreter
Device capabilities
No response
Description
Hi,
As discussed on Discord, we have an issue with an HTTPS WebServer where at some point (usually, after ~32 requests), the SSL connection is no longer working and the only fix is a reboot. On the last request, the socket is successfully created, then SslNative.SecureServerInit() seems to works correctly and the certificate is sent, but an exception occurs in SslNative.SecureAccept() and the keys are not exchanged.
I don't totally understand what is done with it, but it is the second certificate allocated, and this one is not freed.
I tried to free it but it breaks the SSL handshake. I guess some parts are still referenced somewhere.
I removed the allocation and replaced all uses with context->x509_crt : it works and the memory seems stable.
I probably broke some use case while doing this, so this needs someone who knows better that part of the codebase.
Library/API/IoT binding
nanoFramework.System.Net, nanoFramework.System.Net.Http
Visual Studio version
VS2022 (17.13.57)
.NET nanoFramework extension version
2022.12.1.36
Target name(s)
ESP32_S3
Firmware version
Customized to add Ethernet, up to date with main NF_interpreter
Device capabilities
No response
Description
Hi,
As discussed on Discord, we have an issue with an HTTPS WebServer where at some point (usually, after ~32 requests), the SSL connection is no longer working and the only fix is a reboot. On the last request, the socket is successfully created, then SslNative.SecureServerInit() seems to works correctly and the certificate is sent, but an exception occurs in SslNative.SecureAccept() and the keys are not exchanged.
Without the debuger, it seems we can exchange a few more requests (~2).
When looking at the memory, it seems each request leaks ~2300 bytes, the crash seems to be happening when the device is low on memory.
According to @Ellerbach who could reproduce the leak with a standard image on Wifi, the HTTP is also leaking a bit.
How to reproduce
Expected behaviour
The memory should be freed once the socket is closed and the SSL context is cleared.
Screenshots
(Memory displayed before listening for a new request)
(Memory status around related parts)
Sample project or code
https://bitbucket.org/NovaLynx/nf-https/src/main/
Short NF program + test application
Aditional information
No response
The text was updated successfully, but these errors were encountered: