Add cafile config key
This commit is contained in:
parent
5393734055
commit
398647974c
|
|
@ -35,6 +35,7 @@ https:
|
||||||
keyfile: 'localhost.key'
|
keyfile: 'localhost.key'
|
||||||
passphrase: ''
|
passphrase: ''
|
||||||
certfile: 'localhost.cert'
|
certfile: 'localhost.cert'
|
||||||
|
cafile: ''
|
||||||
|
|
||||||
# Page template values
|
# Page template values
|
||||||
# title goes in the upper left corner, description goes in a <meta> tag
|
# title goes in the upper left corner, description goes in a <meta> tag
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@ var defaults = {
|
||||||
domain: "https://localhost",
|
domain: "https://localhost",
|
||||||
keyfile: "localhost.key",
|
keyfile: "localhost.key",
|
||||||
passphrase: "",
|
passphrase: "",
|
||||||
certfile: "localhost.cert"
|
certfile: "localhost.cert",
|
||||||
|
cafile: ""
|
||||||
},
|
},
|
||||||
io: {
|
io: {
|
||||||
domain: "http://localhost",
|
domain: "http://localhost",
|
||||||
|
|
|
||||||
|
|
@ -78,10 +78,17 @@ var Server = function () {
|
||||||
Config.get("https.keyfile")));
|
Config.get("https.keyfile")));
|
||||||
var cert = fs.readFileSync(path.resolve(__dirname, "..",
|
var cert = fs.readFileSync(path.resolve(__dirname, "..",
|
||||||
Config.get("https.certfile")));
|
Config.get("https.certfile")));
|
||||||
|
var ca = undefined;
|
||||||
|
if (Config.get("https.cafile")) {
|
||||||
|
ca = fs.readFileSync(path.resolve(__dirname, "",
|
||||||
|
Config.get("https.cafile")));
|
||||||
|
}
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
key: key,
|
key: key,
|
||||||
cert: cert,
|
cert: cert,
|
||||||
passphrase: Config.get("https.passphrase")
|
passphrase: Config.get("https.passphrase"),
|
||||||
|
ca: ca
|
||||||
};
|
};
|
||||||
|
|
||||||
self.https = https.createServer(opts, self.express)
|
self.https = https.createServer(opts, self.express)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue