UNPKG

syswide-cas

Version:

Enable node to use system wide certificate authorities in conjunction with the bundled root CAs

25 lines (20 loc) 697 B
console.log(process.version); const selfsigned = "https://self-signed.badssl.com/"; const mozillaModern = "https://mozilla-modern.badssl.com/"; const syswidecas = require("./index"); syswidecas.addCAs("./wildcardSelfSigned.pem"); const request = require("request"); request.get(selfsigned, function(err, res, body) { if (err) { console.log(selfsigned + " error: " + err); } else { console.log(selfsigned + " success. body length: " + body.length); } request.get(mozillaModern, function(err, res, body) { if (err) { console.log(mozillaModern + " error: " + err); } else { console.log(mozillaModern + " success. body length: " + body.length); } }); });