0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/disabled/tls-client.js
2010-12-09 02:46:57 -08:00

23 lines
458 B
JavaScript

var common = require('../common');
var tls = require('tls');
var fs = require('fs');
// most servers don't require certificates
var options = {
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
};
var s = tls.connect(443, "joyent.com", options, function() {
if (!s.authorized) {
console.error("CONNECTED: " + s.authorizationError);
s.destroy();
return;
}
s.pipe(process.stdout);
process.openStdin().pipe(s);
});