Skip to content

Instantly share code, notes, and snippets.

@ry
Created December 8, 2010 21:48
Show Gist options
  • Save ry/733976 to your computer and use it in GitHub Desktop.
Save ry/733976 to your computer and use it in GitHub Desktop.
// new node.js tls api
var tls = require('tls');
var fs = require('fs');
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
var server = tls.createServer(options, function (s) {
s.write("welcome!\n");
s.pipe(s);
}).listen(8000);
@brainpicture
Copy link

Can you help me, how can I start encrypted communication at the middle of TCP connection consider new api?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment