Adding support for providing intermediate CA certificates when running etherpad-lite with ssl through Node/expressjs

This commit is contained in:
Andreas Åkre Solberg 2015-04-22 20:29:19 +02:00
parent d31523aa08
commit ec7b3fc787
2 changed files with 8 additions and 0 deletions

View File

@ -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"]
},
*/

View File

@ -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);