From 480552a25a9b938b77b2a39af7fcdfbd756a060a Mon Sep 17 00:00:00 2001 From: Darren Date: Sat, 13 Apr 2013 16:33:51 +0100 Subject: [PATCH] Revised CA cert logic --- server/weblistener.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server/weblistener.js b/server/weblistener.js index f59723b..27c8eab 100644 --- a/server/weblistener.js +++ b/server/weblistener.js @@ -47,13 +47,16 @@ var WebListener = function (web_config, transports) { }; // Do we have an intermediate certificate? - if (typeof web_config.ssl_ca.map !== 'undefined') { - opts.ca = web_config.ssl_ca.map(function (f) { return fs.readFileSync(f); }); - } else if (typeof web_config.ssl_ca !== 'undefined') { - opts.ca = fs.readFileSync(web_config.ssl_ca); + if (typeof web_config.ssl_ca !== 'undefined') { + // An array of them? + if (typeof web_config.ssl_ca.map !== 'undefined') { + opts.ca = web_config.ssl_ca.map(function (f) { return fs.readFileSync(f); }); + + } else { + opts.ca = fs.readFileSync(web_config.ssl_ca); + } } - hs = https.createServer(opts, handleHttpRequest); // Start socket.io listening on this weblistener -- 2.25.1