mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
23 lines
458 B
JavaScript
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);
|
|
});
|
|
|