summaryrefslogtreecommitdiffstats
path: root/dgbuilder/red.js
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-08-19 14:17:14 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-19 14:17:14 +0000
commit9dc7bdbbd46f2e3016617b6d0a1ad394d5771439 (patch)
tree23140d5b409f681306595ebd7504a23c549e5745 /dgbuilder/red.js
parenta8e9cf344e47ddca11b856e3b442da15f670826c (diff)
parent347321e1530e50084d54b2428fc3b6310853c957 (diff)
Merge "[CCSDK-1579] updated to use https"
Diffstat (limited to 'dgbuilder/red.js')
-rw-r--r--dgbuilder/red.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/dgbuilder/red.js b/dgbuilder/red.js
index 14f6d38c..460b2efd 100644
--- a/dgbuilder/red.js
+++ b/dgbuilder/red.js
@@ -21,7 +21,7 @@ var crypto = require("crypto");
var nopt = require("nopt");
var path = require("path");
var RED = require("./red/red.js");
-
+var fs = require('fs')
var server;
var app = express();
@@ -77,8 +77,12 @@ if (parsedArgs.v) {
settings.verbose = true;
}
-if (settings.https) {
- server = https.createServer(settings.https,function(req,res){app(req,res);});
+if (settings.enableHttps) {
+ //server = https.createServer(settings.https,function(req,res){app(req,res);});
+ server = https.createServer({
+ key: fs.readFileSync('certs/node-key.pem'),
+ cert: fs.readFileSync('certs/node-cert.pem'),
+ requireHttps : true},function(req,res){app(req,res);});
} else {
server = http.createServer(function(req,res){app(req,res);});
}
@@ -159,7 +163,7 @@ if (settings.httpStatic) {
}
function getListenPath() {
- var listenPath = 'http'+(settings.https?'s':'')+'://'+
+ var listenPath = 'http'+(settings.enableHttps?'s':'')+'://'+
(settings.uiHost == '0.0.0.0'?'127.0.0.1':settings.uiHost)+
':'+settings.uiPort;
if (settings.httpAdminRoot !== false) {