Skip to content
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

Fix connection options and update github pubkey #5120

Merged
merged 4 commits into from
Sep 17, 2018

Conversation

earlephilhower
Copy link
Collaborator

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

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) {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@devyte devyte merged commit cd43337 into esp8266:master Sep 17, 2018
d-a-v pushed a commit to d-a-v/Arduino that referenced this pull request Sep 18, 2018
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
@d-a-v d-a-v mentioned this pull request Oct 6, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants