Add cafile config key

This commit is contained in:
calzoneman 2014-03-05 22:26:10 -06:00
parent 5393734055
commit 398647974c
3 changed files with 11 additions and 2 deletions

View file

@ -35,6 +35,7 @@ https:
keyfile: 'localhost.key'
passphrase: ''
certfile: 'localhost.cert'
cafile: ''
# Page template values
# title goes in the upper left corner, description goes in a <meta> tag

View file

@ -37,7 +37,8 @@ var defaults = {
domain: "https://localhost",
keyfile: "localhost.key",
passphrase: "",
certfile: "localhost.cert"
certfile: "localhost.cert",
cafile: ""
},
io: {
domain: "http://localhost",

View file

@ -78,10 +78,17 @@ var Server = function () {
Config.get("https.keyfile")));
var cert = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.certfile")));
var ca = undefined;
if (Config.get("https.cafile")) {
ca = fs.readFileSync(path.resolve(__dirname, "",
Config.get("https.cafile")));
}
var opts = {
key: key,
cert: cert,
passphrase: Config.get("https.passphrase")
passphrase: Config.get("https.passphrase"),
ca: ca
};
self.https = https.createServer(opts, self.express)