Skip to content

Commit 4cedb61

Browse files
committed
MbedClient::connectSSL set timeout before TLS handshake starts
1 parent 69e563e commit 4cedb61

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/SocketWrapper/src/MbedClient.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ int arduino::MbedClient::connectSSL(SocketAddress socketAddress) {
150150
return 0;
151151
}
152152

153+
/* For TLS connection timeout needs to be configured before handshake starts
154+
* otherwise socket timeout is not adopted. See TLSSocketWrapper::set_timeout(int timeout)
155+
*/
156+
sock->set_timeout(_timeout);
157+
153158
restart_connect:
154159
nsapi_error_t returnCode = static_cast<TLSSocket *>(sock)->connect(socketAddress);
155160
int ret = 0;

0 commit comments

Comments
 (0)