1

I'm running my express / node.js app on a webfaction server and want to install the SSL certificates I received from Comodo... I usually self-generated two files - private and public - on my local server, but for my site I generated external ones and they sent me 4

Root CA Certificate - AddTrustExternalCARoot.crt
Intermediate CA Certificate - COMODORSAAddTrustCA.crt
Intermediate CA Certificate - COMODORSADomainValidationSecureServerCA.crt
Your EssentialSSL Certificate - website_com.crt

Do you know what I should do with those if what I need to write in my app.js instead of ?????

var options = {
    key: fs.readFileSync(????)
    cert: fs.readFileSync(????)
     ca: fs.readFileSync(????)
 };

Thank you!

PS I thought you have to cat some files together, but which ones you think of the ones above?

Aerodynamika
  • 7,883
  • 16
  • 78
  • 137

1 Answers1

1

Your options would need to look something like this:

var options = {
    key: fs.readFileSync('/path/to/yourprivatekey.pem'),
    cert: fs.readFileSync('/path/to/website_com.crt'),
    ca: [
        fs.readFileSync('/path/to/COMODORSAAddTrustCA.crt'),
        fs.readFileSync('/path/to/COMODORSADomainValidationSecureServerCA.crt')
    ]
};

You do not need to add AddTrustExternalCARoot.crt to your ca list as all browsers should have the root.

Similar question: How to setup EV Certificate with nodejs server

Anand Bhat
  • 5,591
  • 26
  • 30