starttls on node.js > 0.4.0

1.1k views Asked by At

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?

2

There are 2 answers

2
TooTallNate On BEST ANSWER
0
BMiner On

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