diff --git a/cloudcmd.js b/cloudcmd.js index 8a4df337..dd307695 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -184,8 +184,8 @@ if(Config.ssl) lParams.ssl = { - key : fs.readFileSync(__dirname + '/privatekey.pem'), - cert : fs.readFileSync(__dirname + '/certificate.pem') + key : fs.readFileSync(DIR + 'ssl/privatekey.pem'), + cert : fs.readFileSync(DIR + 'ssl/certificate.pem') }; server.start(lParams); diff --git a/lib/server.js b/lib/server.js index 2850c698..ed54f86c 100644 --- a/lib/server.js +++ b/lib/server.js @@ -80,9 +80,11 @@ if (lConfig.server) { var lError = Util.tryCatchLog(function(){ if(!lSSL) - Server = http.createServer( controller ); - else - Server = https.createServer( lSSL, controller ); + Server = http.createServer( controller ); + else{ + Server = https.createServer( lSSL, controller ); + Port = 443; + } Server.listen(Port, IP); var lListen;