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

Keep client certs when server authentication set #7464

Merged
merged 2 commits into from
Jul 17, 2020

Conversation

earlephilhower
Copy link
Collaborator

WiFiClientSecure.setInsecure() was clearing the secret key (but not the
_chain public client cert) incorrectly. The other server authentication
modes also had the same effect.

The only way for it to work would be if the app first set the server
authentication method and then the client keys. There's no good reason
for this.

Adjust the connection to only clear the server id methods and leave the
client ID untouched.

Fixes #7455

WiFiClientSecure.setInsecure() was clearing the secret key (but not the
_chain public client cert) incorrectly.  The other server authentication
modes also had the same effect.

The only way for it to work would be if the app first set the server
authentication method and then the client keys.  There's no good reason
for this.

Adjust the connection to only clear the server id methods and leave the
client ID untouched.

Fixes esp8266#7455
@earlephilhower earlephilhower merged commit 91427a1 into esp8266:master Jul 17, 2020
@earlephilhower earlephilhower deleted the setinsec1 branch July 17, 2020 21:08
d-a-v added a commit that referenced this pull request Jul 18, 2020
earlephilhower added a commit to earlephilhower/Arduino that referenced this pull request Jul 23, 2020
PR esp8266#7464 removed the reset of client authentication settings when server
authentication settings were changed, however it never did initialize
the client authentication information to nullptr in the constructor.
This can result in crashes during connections when client certs are not
applied.

Fix by resetting the client authenticaion variables on object
construction.
earlephilhower added a commit that referenced this pull request Jul 23, 2020
PR #7464 removed the reset of client authentication settings when server
authentication settings were changed, however it never did initialize
the client authentication information to nullptr in the constructor.
This can result in crashes during connections when client certs are not
applied.

Fix by resetting the client authenticaion variables on object
construction.
earlephilhower added a commit to earlephilhower/Arduino that referenced this pull request Aug 3, 2020
Run valgrind on host mock example runs to catch more bugs in CI.  These
tests would have caught the problem in esp8266#7464 before users did.

Add a list of some randomly picked examples to run, and add an option to
run the loop exactly once in the host mock routine, so the test will
actually exit under valgrind.
earlephilhower added a commit that referenced this pull request Aug 4, 2020
Run valgrind on host mock example runs to catch more bugs in CI.  These
tests would have caught the problem in #7464 before users did.

Add a list of some randomly picked examples to run, and add an option to
run the loop exactly once in the host mock routine, so the test will
actually exit under valgrind.
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.

Client certs removed from connection when setInsecure called, causing SSL connect failure.
1 participant