Last active
February 7, 2017 11:49
-
-
Save alexmccabe/68f41151a43cf64b637d744ddf689519 to your computer and use it in GitHub Desktop.
How to get SSL Chain Certificates in NodeJS. This took me a very long time to figure out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to get SSL Chain certificate in NodeJS | |
/** | |
* You will receive multiple files from the SSL Certificate provider, one is | |
* the certificate, one is the bundle. Node requires this to be in a single | |
* .cert file. | |
* | |
* To do this from the terminal, concatonate the files together. | |
* cat website.com.crt bundle_name.crt > output-bundle.crt | |
*/ | |
var httpsKeys = { | |
key: fs.readFileSync(path.normalize(__dirname + '/../config/ssl/node.kerve.com.key'), 'utf-8'), | |
cert: fs.readFileSync(path.normalize(__dirname + '/../config/ssl/bundle.crt'), 'utf-8'), | |
requestCert: true, | |
rejectUnauthorized: false | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment