Node.js specify tls connect timeout

落爺英雄遲暮 提交于 2019-12-11 11:22:10

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/23309527/node-js-specify-tls-connect-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!