简体   繁体   中英

How to install rapid ssl certificate in nodejs express application

I have the SSL certificate from the rapid SSL and Rapid SSL issued the certificate to the server. Now I have 4 files. CACertificate-INTERMEDIATE-1.cer

CACertificate-ROOT-2.cer
PKCS7.p7b
CACertificate-INTERMEDIATE-1.cer
ServerCertificate.cer

Then how to configure the server to it.

ssl-root-cas module helps to use custom certifcates on your node.js server.

You can inject your custom certificate doing:

require('ssl-root-cas').addFile('my-cert.crt');

Have a look to this article that explains how to use ssl/tls certifcates on your node.js app:

https://www.sitepoint.com/how-to-use-ssltls-with-node-js/

If I understood you correctly, you want to setup HTTPS for you node.js web server.

If you are using plain node.js, then you will have to switch from http module to https module. Take a look at the docs: https://nodejs.org/dist/latest-v8.x/docs/api/https.html#https_https_createserver_options_requestlistener

If you are using some kind of a framework, you will need to consult its docs.

Usually you need a server certificate and a corresponding private key . The files that you were provided with look like a certificate chain (root CA cert -> intermediate CA cert -> your server cert). The files name ServerCertificate.cer conveys a feeling that it is a server certificate . But where is your private key file? You should consult certificate issuer to find this out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM