mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-27 21:16:50 +03:00
Configurable WiFiClientSecure connect timeout, better default value (#4027)
* WiFiClientSecure: use _timeout setting when connecting This timeout value can be customized via a call to setTimeout function. Closes https://github.com/esp8266/Arduino/issues/3944. * WiFiClientSecure: increase default connection timeout to 15 sec
This commit is contained in:
parent
ddda374985
commit
fac64900dd
@ -404,6 +404,8 @@ ClientContext* SSLContext::s_io_ctx = nullptr;
|
||||
|
||||
WiFiClientSecure::WiFiClientSecure()
|
||||
{
|
||||
// TLS handshake may take more than the 5 second default timeout
|
||||
_timeout = 15000;
|
||||
}
|
||||
|
||||
WiFiClientSecure::~WiFiClientSecure()
|
||||
@ -459,7 +461,7 @@ int WiFiClientSecure::_connectSSL(const char* hostName)
|
||||
_ssl = new SSLContext;
|
||||
_ssl->ref();
|
||||
}
|
||||
_ssl->connect(_client, hostName, 5000);
|
||||
_ssl->connect(_client, hostName, _timeout);
|
||||
|
||||
auto status = ssl_handshake_status(*_ssl);
|
||||
if (status != SSL_OK) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user