diff options
author | Andreas Åkre Solberg <andreas.solberg@uninett.no> | 2015-04-22 20:29:19 +0200 |
---|---|---|
committer | Andreas Åkre Solberg <andreas.solberg@uninett.no> | 2015-04-22 20:29:19 +0200 |
commit | ec7b3fc787bee9ea11547d1e8e5d8e160fdfc18e (patch) | |
tree | eada46e19846f4648f4887b7c6db0d1d51bc0f54 | |
parent | d31523aa08d123f421248e249e2194f7689f0b06 (diff) | |
download | etherpad-lite-ec7b3fc787bee9ea11547d1e8e5d8e160fdfc18e.zip |
Adding support for providing intermediate CA certificates when running etherpad-lite with ssl through Node/expressjs
-rw-r--r-- | settings.json.template | 1 | ||||
-rw-r--r-- | src/node/hooks/express.js | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/settings.json.template b/settings.json.template index 39c383ed..7d9c62cc 100644 --- a/settings.json.template +++ b/settings.json.template @@ -25,6 +25,7 @@ "ssl" : { "key" : "/path-to-your/epl-server.key", "cert" : "/path-to-your/epl-server.crt" + "ca": ["/path-to-your/epl-intermediate-cert1.crt", "/path-to-your/epl-intermediate-cert2.crt"] }, */ diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index 3abe41f8..1752f5d0 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -46,6 +46,13 @@ exports.restartServer = function () { key: fs.readFileSync( settings.ssl.key ), cert: fs.readFileSync( settings.ssl.cert ) }; + if (settings.ssl.ca) { + options.ca = []; + for(var i = 0; i < settings.ssl.ca.length; i++) { + var caFileName = settings.ssl.ca[i]; + options.ca.push(fs.readFileSync(caFileName)); + } + } var https = require('https'); server = https.createServer(options, app); |