-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
bearssl_validation example invalid public key #5086
Comments
CC @earlephilhower |
@chegewara BearSSL handles both DER and PEM (base64 and binary) certificates. It's entirely possible the Github cert has changed, they've changed more than once since I started working on BearSSL early this year. That's why it's not a good idea to hardcode certs (unless you control them!), but the code itself is a sample and github seemed like as good a website to show things on as any. If you've tested the new one extracted in DER format, please put in a PR w/the update and I can merge easily once tested. The certificate SHA1 fingerprint would also be different, if the public key is changed, so please update both. |
@earlephilhower I can understand that and im not complaining, just wanted to provide some information (sorry if i dont follow issue template). There is one more question, in this example is also used digicert ca root certificate. This certificate is not changed but fetchCertAuthority is not working too:
I may not understand some things yet, but another weird thing with this example is when i move setClock() just few lines above i get this log output (first time with set time i can connect but not second time). Code:
and logs:
EDIT for some reason fingerprint match but public key does not |
Another strange behavior, when i try two requests then i get response from both:
but when i try only PS this time with my server, not the one from example |
Interesting observations! I'm still traveling so haven't been able to look at this, but do appreciate the debug. The example was running before, believe it or not. My first guess is that something changed in the core that's interacting weirdly now (but just a guess), because the SSL code hasn't really been tweaked recently AFAIR. BearSSL also just released an 0.6 "official beta" version so I need to update it anyway, so this is a good time to check the plumbing too. |
Sorry i cant perform more test and to provide more info, but i have limited access to electricity now. |
I have tried the example with similar results, however, I did some testing to try to discover what may be causing these results. Here is what I have found:
|
Update on my previous comment:
|
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
The root cause was a regression due to the prior update which effectively cleared connection option flags during the connect sometimes. Simple fix and things are back running again (with updated GH key):
|
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
This public key seems to be invalid:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino#L134-L140
This is valid public key:
The text was updated successfully, but these errors were encountered: