diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index 7bc0c70df6..9d694f731e 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -1208,6 +1208,7 @@ bool WiFiClientSecureCtx::_connectSSL(const char* hostName) { // reduce timeout after successful handshake to fail fast if server stop accepting our data for whathever reason if (ret) _timeout = 5000; + else _freeSSL(); return ret; }