Revised CA cert logic
authorDarren <darren@Darrens-MacBook-Pro.local>
Sat, 13 Apr 2013 15:33:51 +0000 (16:33 +0100)
committerDarren <darren@Darrens-MacBook-Pro.local>
Sat, 13 Apr 2013 15:33:51 +0000 (16:33 +0100)
server/weblistener.js

index f59723bf0739f5cd099a8430e61f38552708afb1..27c8eab0c4596b2b608ddaf978282c73964bd351 100644 (file)
@@ -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