1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

Fix minor BearSSL API issues (#4901)

Fixes #4882 and updates GitHub certificate fingerprint to the current one
in BearSSL_Validation example.

When setting a authentication mode or stopping, clear all others out in case
the object is being re-used.

Add in a yield during the SSL handshake to allow a graceful timeout and not
a WDT error when the remote server hiccups.  Thanks to @Jeroen88 for
finding and testing this.
This commit is contained in:
Earle F. Philhower, III
2018-07-16 09:35:00 -07:00
committed by GitHub
parent fcf2ac5d3d
commit 53091882b8
3 changed files with 9 additions and 1 deletions

View File

@ -79,6 +79,7 @@ void WiFiClientSecure::_clearAuthenticationSettings() {
_use_self_signed = false;
_knownkey = nullptr;
_sk = nullptr;
_ta = nullptr;
}
@ -177,6 +178,7 @@ void WiFiClientSecure::stop() {
_client->abort();
}
WiFiClient::stop();
_clearAuthenticationSettings();
_freeSSL();
}
@ -510,6 +512,7 @@ bool WiFiClientSecure::_wait_for_handshake() {
if (br_ssl_engine_current_state(_eng) & BR_SSL_SENDAPP) {
_handshake_done = true;
}
optimistic_yield(1000);
}
return _handshake_done;
}