-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WiFiClientSecure self signed cert support? #265
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
Comments
@forthlightning @copercini So, I did some digging and found some changes in ssl_client.cpp that seemed to be the cause of the issue. In commit #255 the while() loop from line 241 onward was changed to return an error code, rather than printing out a handshake code and then breaking from the while loop. I was not sure of intent of the change (i.e. whether it was an intended feature) , but tried changing this back to the original pre-#255 code as follows and everything began to work again:-) ` DEBUG_PRINT( "Performing the SSL/TLS handshake...\n");
I realise that the printf statement may need to be upgraded to a DEBUG_PRINT, to match the new style, but did not want to play too much with the code. As I'm only a newbie, I was not sure of the appropriate way to request a code change, but hope it is of some use. |
Error should be exposed better. @copercini the client should act as any other client. All that is needed as error info for the handshake is to be exposed as some method that you can query on failed connect. if(!client.conect(...)) Serial.printf("SSL error was: %u\n", client.errorCode()); |
@me-no-dev Yes, and change the internal debug print to be compatible with ESP debug levels. @forthlightning @rodgergr About this issue:
Which looks like a mbedtls bug: Mbed-TLS/mbedtls#506 I am not sure what is the best workaround for WiFiClientSecure avoid this. |
@copercini I would rather you use ESP32 Arduino's debug procedures ( |
* Support self signed certificates Fix for #265 mbedtls_ssl_conf_authmode was defined before mbedtls_ssl_config_defaults causing several bugs when no CA certificate is defined. * Implement Arduino's log facility Replace printf by ESP log handling * Remove \n from debug messages log_ doesn't need \n to break line.
@forthlightning @rodgergr |
@copercini I downloaded the latest core version and sslclient now works fine with a self-signed certificate😀Thanks for all of your hard work👍 |
same here, this is great! |
lets close this then :) |
Added #undef min and #undef max in cores/esp32/Arduino.h Fixed ssl_client.cpp in libraries/WiFiClientSecure/src This should be self-signed certs. Fixed the issue per link below: espressif/arduino-esp32#265
* Support self signed certificates Fix for espressif/arduino-esp32#265 mbedtls_ssl_conf_authmode was defined before mbedtls_ssl_config_defaults causing several bugs when no CA certificate is defined. * Implement Arduino's log facility Replace printf by ESP log handling * Remove \n from debug messages log_ doesn't need \n to break line.
* Support self signed certificates Fix for espressif/arduino-esp32#265 mbedtls_ssl_conf_authmode was defined before mbedtls_ssl_config_defaults causing several bugs when no CA certificate is defined. * Implement Arduino's log facility Replace printf by ESP log handling * Remove \n from debug messages log_ doesn't need \n to break line.
* Support self signed certificates Fix for espressif/arduino-esp32#265 mbedtls_ssl_conf_authmode was defined before mbedtls_ssl_config_defaults causing several bugs when no CA certificate is defined. * Implement Arduino's log facility Replace printf by ESP log handling * Remove \n from debug messages log_ doesn't need \n to break line.
WiFiClientSecure supported self-signed certs (perhaps accidentally) up until this commit. Is there a way to enable self signed operation?
The text was updated successfully, but these errors were encountered: