Fix ENOENT for people with HTTPS disabled

This commit is contained in:
calzoneman 2014-04-12 21:52:06 -05:00
parent 85c62b1579
commit 7c252eab2f
1 changed files with 10 additions and 8 deletions

View File

@ -70,15 +70,17 @@ var Server = function () {
require("./web/webserver").init(self.express); require("./web/webserver").init(self.express);
// http/https/sio server init ----------------------------------------- // http/https/sio server init -----------------------------------------
var key = fs.readFileSync(path.resolve(__dirname, "..", var key = "", cert = "", ca = undefined;
if (Config.get("https.enabled")) {
key = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.keyfile"))); Config.get("https.keyfile")));
var cert = fs.readFileSync(path.resolve(__dirname, "..", cert = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.certfile"))); Config.get("https.certfile")));
var ca = undefined;
if (Config.get("https.cafile")) { if (Config.get("https.cafile")) {
ca = fs.readFileSync(path.resolve(__dirname, "..", ca = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.cafile"))); Config.get("https.cafile")));
} }
}
var opts = { var opts = {
key: key, key: key,