From 1768c721350cce16f406f13f05e886fc0b7d3d2c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 29 Mar 2011 09:58:50 -0700 Subject: [PATCH] Add doc note about STARTTLS --- doc/api/tls.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index fd1b2330fc8..e4ded41a775 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -51,6 +51,19 @@ signed by one of the specified CAs. If `s.authorized === false` then the error can be found in `s.authorizationError`. +### STARTTLS + +In the v0.4 branch no function exists for starting a TLS session on an +already existing TCP connection. This is possible it just requires a bit of +work. The technique is to use `tls.createSecurePair()` which returns two +streams: an encrypted stream and a plaintext stream. The encrypted stream is then +piped to the socket, the plaintext stream is what the user interacts with thereafter. + +[Here is some code that does it.](http://gist.github.com/848444) + + + + ### tls.Server This class is a subclass of `net.Server` and has the same methods on it.