-
Notifications
You must be signed in to change notification settings - Fork 46
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
Calls to stop before connected cause lockups. #13
Comments
Is the behavior a crash or a freeze? In my experience BearSSL attempts to close the connection by sending a |
I think 4707ea4 should fix the |
The behaviour is a crash rather than a freeze. The new commit fixes this with a fresh stop before connect, after a client has connected and disconnected AND if the client is connected. |
Oh just to add, if you have network connectivity, a connected socket, but temporarily no route to the server and are using the Arduino Ethernet 2.0 library, you will need the following change in the EthernetClient.cpp for this commit to fix these issues (as calls to get_arduino_client().flush() in this configuration will hang indefinitely when there's no route). This is also true for calls to flush in the m_update_engine of SSLClient, and considering the lack of development effort in Ethernet, it might have to be a recommendation in SSLClient (particularly if using PubSubClient because of the regular pings which are susceptible to minor lapses in network connectivity).
This has been PRed into Paul's "fork" of the Arduino repo - PaulStoffregen/Ethernet@master...bleckers:patch-1 |
Hmmm yeah, I don't think I have a good way of enforcing a timeout on |
Describe the bug
Calling sslClient.stop() when !sslClient.connected() causes buffer overflow, even after previously successful connection (and disconnect).
To Reproduce
EthernetClient mqttEthClient;
Ethernet.init(14);
SSLClient sslClient(mqttEthClient, TAs_HTTPS, (size_t)TAs_NUM_HTTPS, RANDOM_DATA_PIN);
sslClient.stop();
Expected behavior
Calls to stop should exit gracefully or ignore the request if already exited.
Context (please complete the following information):
Additional context
Discovered while trying to make the library robust to internet connectivity issues. Removing jump_handshake in br_ssl_engine_close prevents this (not a fix).
The text was updated successfully, but these errors were encountered: