starttls on node.js > 0.4.0

对着背影说爱祢 提交于 2019-12-11 01:18:31

问题


I came across this thread Node.js HTTPS Secure Error which mentions that the tls module is the way to do TLS on node now. It seems that setSecure() has been dropped. I'm trying to do a STARTTLS for XMPP. This means that the socket will be upgraded midway. How do I go about doing this on node.js > 0.4.0?


回答1:


Try this: https://gist.github.com/848444




回答2:


Take a close look at the lib/tls.js file in the Node Github repo.

https://github.com/joyent/node/blob/master/lib/tls.js#L949-992

Another resource that you really might like is here:

https://github.com/andris9/rai/blob/master/lib/starttls.js



来源:https://stackoverflow.com/questions/5146666/starttls-on-node-js-0-4-0

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