-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix connection options and update github pubkey #5120
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
Conversation
As part of the "clear connection configuration for reused objects" patch, a ::stop would reset the self-signed, trust anchors, etc. WiFiClient, unfortunately, calls ::stop as part of the connection process, so all of these settings were lost. Now only clear the connection settings on ::stop if we've already been connected. Also update the github public key which changed yet again. Fixes esp8266#5086
@@ -179,7 +179,10 @@ void WiFiClientSecure::stop() { | |||
_client->abort(); | |||
} | |||
WiFiClient::stop(); | |||
_clearAuthenticationSettings(); | |||
// Only if we've already connected, clear the connection options | |||
if (_handshake_done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if I set up a connection, attempting to connect fails (_handshake_done never becomes true), and then decide to abort and call stop()? Won't the flags remain?
What if the certs are then changed and a different connection is attempted? won't the previous flags be still there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a feature not a bug :)
In a connection loop in the main so you set the options and while (! Connected) try and connect. No need to reapply any settings since it hasn't moved further.
Due to the flow inside wificlient which calls stop even in connections that were never opened, I think this is the best we can do.
As part of the "clear connection configuration for reused objects" patch, a ::stop would reset the self-signed, trust anchors, etc. WiFiClient, unfortunately, calls ::stop as part of the connection process, so all of these settings were lost. Now only clear the connection settings on ::stop if we've already been connected. Also update the github public key which changed yet again. Fixes esp8266#5086
As part of the "clear connection configuration for reused objects"
patch, a ::stop would reset the self-signed, trust anchors, etc.
WiFiClient, unfortunately, calls ::stop as part of the connection
process, so all of these settings were lost.
Now only clear the connection settings on ::stop if we've already
been connected.
Also update the github public key which changed yet again.
Fixes #5086