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);
// http/https/sio server init -----------------------------------------
var key = fs.readFileSync(path.resolve(__dirname, "..",
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 key = "", cert = "", ca = undefined;
if (Config.get("https.enabled")) {
key = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.keyfile")));
cert = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.certfile")));
if (Config.get("https.cafile")) {
ca = fs.readFileSync(path.resolve(__dirname, "..",
Config.get("https.cafile")));
}
}
var opts = {