Skip to content

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
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
@earlephilhower earlephilhower deleted the ghkey branch September 30, 2018 17:43
@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