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,14 +70,16 @@ 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;
Config.get("https.keyfile"))); if (Config.get("https.enabled")) {
var cert = fs.readFileSync(path.resolve(__dirname, "..", key = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.certfile"))); Config.get("https.keyfile")));
var ca = undefined; cert = fs.readFileSync(path.resolve(__dirname, "..",
if (Config.get("https.cafile")) { Config.get("https.certfile")));
ca = fs.readFileSync(path.resolve(__dirname, "..", if (Config.get("https.cafile")) {
Config.get("https.cafile"))); ca = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.cafile")));
}
} }
var opts = { var opts = {