From 5a5b49241588f26d648cdfa31cea1ca5ea519678 Mon Sep 17 00:00:00 2001 From: dabura667 Date: Wed, 10 Jun 2015 22:31:40 +0900 Subject: [PATCH] Added ability to designate CA root (for small CAs) --- bws.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bws.js b/bws.js index b908fec..f1cbb21 100755 --- a/bws.js +++ b/bws.js @@ -27,6 +27,12 @@ var serverOpts = {}; if (config.https) { serverOpts.key = fs.readFileSync(config.privateKeyFile || './ssl/privatekey.pem'); serverOpts.cert = fs.readFileSync(config.certificateFile || './ssl/certificate.pem'); + // This sets the intermediate CA certs only if they have all been designated in the config.js + if (config.CAinter1 && config.CAinter2 && config.CAroot) { + serverOpts.ca = [fs.readFileSync(config.CAinter1), + fs.readFileSync(config.CAinter2), + fs.readFileSync(config.CAroot) + ];}; } var start = function(cb) {