aboutsummaryrefslogtreecommitdiffstats
path: root/admportal/shell
diff options
context:
space:
mode:
authorRotundo, Alfred (ar3165) <ar3165@att.com>2018-11-20 19:31:46 +0000
committerTimoney, Dan (dt5972) <dtimoney@att.com>2019-04-09 15:34:18 -0400
commit67710454be20dbff2330dde919f837d850ed50ed (patch)
tree141d3dc44929f7b6d4d06e64b9f9f68b9f719693 /admportal/shell
parentf3c9e00fd74a3db4a5e4b9cfeaf6cc88bbe45e55 (diff)
Add new HTTPS listener on port 8443
Changes made: expose port 8443 from container added new listener to listen on that port added cert when starting up Change-Id: I5106192d55d51fd340f28b9eace0c5ea83afcd99 Issue-ID: SDNC-528 Signed-off-by: Rotundo, Alfred (ar3165) <ar3165@att.com> Former-commit-id: 77710f34952c5ac8d6f8250d90b03b43de1a4a5b
Diffstat (limited to 'admportal/shell')
-rwxr-xr-xadmportal/shell/www44
1 files changed, 36 insertions, 8 deletions
diff --git a/admportal/shell/www b/admportal/shell/www
index 29710dbb..5c639e8f 100755
--- a/admportal/shell/www
+++ b/admportal/shell/www
@@ -1,14 +1,42 @@
#!/usr/bin/env node
var debug = require('debug')('admportal');
var app = require('../server/app');
+var constants = require('constants');
var properties = require(process.env.SDNC_CONFIG_DIR + '/admportal.json');
-var out_file = "/opt/openecomp/sdnc/admportal/logs/http_admportal.log";
-var error_file = "/opt/openecomp/sdnc/admportal/logs/error_http_admportal.log";
-var cwd = "/opt/openecomp/sdnc/admportal";
+var out_file = "/opt/onap/sdnc/admportal/logs/http_admportal.log";
+var error_file = "/opt/onap/sdnc/admportal/logs/error_http_admportal.log";
+var cwd = "/opt/onap/sdnc/admportal";
-app.set('port', properties.nonSslPort || 8181 );
+var fs = require('fs.extra');
+var https = require('https');
+var http_port = properties.nonSslPort;
+var https_port = properties.ConexusNetworkPort;
+var cert_pswd = process.env.CERT_PSWD;
-var server = app.listen(app.get('port'), function() {
- console.log('Express server listening on port ' + server.address().port);
- debug('Express server listening on port ' + server.address().port);
-});
+if (typeof http_port != 'undefined' && http_port.length > 0)
+{
+ app.set('port', http_port );
+ var server = app.listen(app.get('port'), function()
+ {
+ console.log('Express server listening on port ' + server.address().port);
+ debug('Express server listening on port ' + server.address().port);
+ });
+}
+
+if (typeof https_port != 'undefined' && https_port.length > 0)
+{
+ var sslOptions = {
+ pfx: fs.readFileSync(properties.ConexusNetwork_sslCert),
+ passphrase: properties.ConexusNetwork_sslKey,
+ secureOptions: constants.SSL_OP_NO_TLSv1|constants.SSL_OP_NO_SSLv2|constants.SSL_OP_NO_SSLv3,
+ ciphers: [ "AES128-GCM-SHA256","!RC4","HIGH","!MD5","!aNULL","!EDH","!3DES" ].join(':'),
+ honorCipherOrder: true,
+ requestCert: true,
+ rejectUnauthorized: false
+ };
+ app.set('port', https_port);
+ var secureServer = https.createServer(sslOptions,app).listen(app.get('port'), function(){
+ console.log('Express server (https) listening on port ' + secureServer.address().port);
+ debug('Express server (https) listening on port ' + secureServer.address().port);
+ });
+}