We\'re trying to use Node.js (and Mocha) as a testing framework to test API calls against an internal server over https. We\'re using the following node modules: Mocha, Restify
To resolve the issue, please install the module node_extra_ca_certs_mozilla_bundle
using
npm install --save node_extra_ca_certs_mozilla_bundle
And then use it in you code with :
const fs = require('fs');
const https = require('https');
https.globalAgent.options.ca = yourCertificatePEMcontent + fs.readFileSync('node_modules/node_extra_ca_certs_mozilla_bundle/ca_bundle/ca_intermediate_root_bundle.pem');
This approach works for me.