-
Notifications
You must be signed in to change notification settings - Fork 573
setFingerprint in WiFiClientSecure required to pass certificate Check #567
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
…d in beginSSL or no connection will start;
sounds like some changes in the SSL support for the ESP where made in the Arduino core. the code normally checks the fingerprint here: arduinoWebSockets/src/WebSocketsClient.cpp Line 774 in 05ec18e
|
Sorry, I forgot to mention it, I'm using ESP8266. |
@Links2004 i've seen that Travis CI build failed for ESP32 because no setFingerprint exists but I don't have an ESP32 module to test if |
yes, the ESP32 does not support setFingerprint. error message from ESP32 build:
may this here what we need, since there are cases where CA is used. _client.ssl = new WEBSOCKETS_NETWORK_SSL_CLASS();
_client.tcp = _client.ssl;
if(_CA_cert) {
DEBUG_WEBSOCKETS("[WS-Client] setting CA certificate");
#if defined(ESP32)
_client.ssl->setCACert(_CA_cert);
#elif defined(ESP8266)
_client.ssl->setCACert((const uint8_t *)_CA_cert, strlen(_CA_cert) + 1);
#else
#error setCACert not implemented
#endif
} else if(_fingerprint.length()) {
#if defined(wificlientbearssl_h) && !defined(USING_AXTLS) && !defined(wificlientsecure_h)
_client.ssl->setFingerprint(_fingerprint.c_str());
#endif
} |
I tried this piece of code and it works for ESP8266 |
I pushed the changes, let me know if everything is ok. |
looks good build has passed for ESP32 and ESP8266 |
some more changes are coming via #569 |
Hi,
I'm having trouble with SSL Connection with sockets.streamlabs.com using fingerprint, I found that no fingerprint is passed to WiFiClientSecure so the check break up.
I'm using SocketIoClient and my piece of code is:
And I receive this log error on connection:
As you can see handshake failed and there is this line of log:
BSSL:Couldn't connect. Error = 'Certificate is expired or not yet valid.'
this is why no fingerprint is valorized.
I made this fix that resolve the problem, let me know if it's ok.