nodejs-self-signed-certific.../request-without-warnings.js

23 lines
488 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
'use strict';
var https = require('https')
, fs = require('fs')
, path = require('path')
, ca = fs.readFileSync(path.join(__dirname, 'client', 'my-private-root-ca.crt.pem'))
2014-07-15 03:38:33 +00:00
, port = process.argv[2] || 8043
, hostname = process.argv[3] || 'local.ldsconnect.org'
;
var options = {
2014-07-15 03:38:33 +00:00
host: hostname
, port: port
, path: '/'
, ca: ca
};
options.agent = new https.Agent(options);
https.request(options, function(res) {
res.pipe(process.stdout);
}).end();