Does your intermediate certificate file contains multiple certificate blocks?
If that's the case you should split them into different files and read them one by one. You can pass them as an array to the ca
parameter.
I've got it working with the code below:
var https = require('https'),
read = require('fs').readFileSync,
httpsOptions = {
key: read('ssl/mycertificate.key', 'utf8'),
cert: read('ssl/mycertificate.crt', 'utf8'),
ca: [
read('ssl/rapidssl_1.pem', 'utf8'),
read('ssl/rapidssl_2.pem', 'utf8')
]
};
https.createServer(httpsOptions, function (req, res) {
// ...
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…