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
I had got the same problem of rest of mine done by https. When I connect with my node clients I obtain those error. The solution for me is to use intermediate certificate.
var key_content = fs.readFileSync('./resources/certificates/foo/foo.es_private_key.key');
var cert_content = fs.readFileSync('./resources/certificates/foo/foo.es_ssl_certificate.crt');
var ca_content = fs.readFileSync('./resources/certificates/foo/_.foo.es_ssl_certificate_INTERMEDIATE.crt');
var options = {
key: key_content,
cert: cert_content,
ca: ca_content
};
var server = https.createServer(options, app);