I am trying to install comodo ssl certificate on node.js using express.js framework server but it's not working. i got 4 crt files from comodo. I am trying the below steps:
var express = require('express'),
fs = require("fs"),
https = require("https");
var options = {
key: fs.readFileSync('/opt/mytestserver.key'),
cert: fs.readFileSync('/opt/mytest.crt'),
ca: fs.readFileSync("/opt/mytestbundle.crt")
};
var server = https.createServer(options, app);
Please help.
Found this unanswered while searching for a solution for myself.
Hope this helps someone- I know it's a bit after the OP.
I was able to get it working by making a folder (I named it certs) with my initial private key and the Comodo domain cert I got in the email. I did copy the other 3 certs from the zip file into the certs folder.
...
var credentials = {
key: fs.readFileSync('certs/privatekey.pem'),
cert: fs.readFileSync('certs/mydomainkeyfromcomodo.crt'),
};
// =============================================================================
// Start the server
// =============================================================================
var https = require('https');
var server = https.createServer(credentials, app);
server.listen(app.get('port'), function() {
console.log('Server up on port ' + app.get('port'));
});
Hope this helps.