Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js specify tls connect timeout

How can I specify timeout for an tls.connect() call? I know there is handshakeTimeout for server, is there something similar for client?

like image 278
sfireman Avatar asked Dec 20 '25 12:12

sfireman


1 Answers

You should be able to call tlssock.setTimeout() which calls the underlying socket.setTimeout(). socket.setTimeout() is the same mechanism that the TLS server uses for the handshakeTimeout.

like image 98
mscdex Avatar answered Dec 23 '25 03:12

mscdex