[CCSDK-1579] updated to use https 89/92589/1
authorChinthakayala, Sheshashailavas (sc2914) <sc2914@att.com>
Fri, 2 Aug 2019 16:22:16 +0000 (16:22 +0000)
committerChinthakayala, Sheshashailavas (sc2914) <sc2914@att.com>
Fri, 2 Aug 2019 16:23:47 +0000 (16:23 +0000)
added a property to customSettings.js to enable https

Change-Id: I6c6adcc6b6e07a3bfaf7ae1e3c304a7a6216ae8f
Signed-off-by: Chinthakayala, Sheshashailavas (sc2914) <sc2914@att.com>
dgbuilder/certs/node-cert.cer [new file with mode: 0644]
dgbuilder/certs/node-cert.pem [new file with mode: 0644]
dgbuilder/certs/node-csr.pem [new file with mode: 0644]
dgbuilder/certs/node-key.pem [new file with mode: 0644]
dgbuilder/createReleaseDir.sh
dgbuilder/red.js
dgbuilder/releases/sdnc1.0/customSettings.js
dgbuilder/src/assembly/assemble_zip.xml

diff --git a/dgbuilder/certs/node-cert.cer b/dgbuilder/certs/node-cert.cer
new file mode 100644 (file)
index 0000000..d944fc7
Binary files /dev/null and b/dgbuilder/certs/node-cert.cer differ
diff --git a/dgbuilder/certs/node-cert.pem b/dgbuilder/certs/node-cert.pem
new file mode 100644 (file)
index 0000000..5e9ddcf
--- /dev/null
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDLjCCAhYCCQDiVieH5hDi5zANBgkqhkiG9w0BAQsFADBZMQswCQYDVQQGEwJV
+UzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMRIwEAYDVQQDDAlkZ2J1aWxkZXIwHhcNMTkwODAyMTQyNjI0WhcN
+MTkwOTAxMTQyNjI0WjBZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKU29tZS1TdGF0
+ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRIwEAYDVQQDDAlk
+Z2J1aWxkZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8p5VLFX+k
+neXJEwcO1fTy2AThZyhzjxGCllEKx5WVRc7vLBVdmFQr8jTbnGGIgPcXOFHzGyO8
+dYRra0tz+sIeBdkNDNRcmDyRVD0ThjDLTCbZ3KZJp8LKDE0iOO4NZVAm6lb8ZNLz
+8hX6rtw9YBOKQXW/WZ0kWIzC0/qnVQUPbtS6kvDcaWIacpGwUkLq0NcNCo9qb14A
+DChMpVtfBj7RRpqEVS9QVQ8VTK9kKT26GPSj4se2jN4Zu7m5ReVO1GcdxmyKAAaB
+0w/bmIfploRehuNFhPVkFJJD5BGjF/YiGhrvJCgqrmrueIwgu3sLXyMXakeJ7sPz
+kg/iLzt5ee93AgMBAAEwDQYJKoZIhvcNAQELBQADggEBAHgvDJvLHRywy157+6o9
+IphXVD0nTpVbEUu+U/16LYo738jMSZzuYIQ1Ud4jVhGBzJj7Rmm18eSbEspSpVwu
+wEy+qI6OVQKatXnEaM7XNv665PuyOMYVplUTyrBapSmJ4EwADos1jBhQj41WnppV
+mE9UuOXmkJefefI+hloyP8JDaRKsfxz7+0QlgPvOQ6WC8GSle6oV89680c7pVINO
+kYwzd0dT/jVtAGDtJxyK37r56dABTde7cBHyxiwhXS1zL8l7aa4XYYUUjbBDvHUp
+2Oab7osfd0k9xK1JyCda1PPBWeKfG1RqSKAsm6WPNiys6pfAhD1H0l7wT2kN+EV5
+RiM=
+-----END CERTIFICATE-----
diff --git a/dgbuilder/certs/node-csr.pem b/dgbuilder/certs/node-csr.pem
new file mode 100644 (file)
index 0000000..33d81f9
--- /dev/null
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIICnjCCAYYCAQAwWTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx
+ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJZGdi
+dWlsZGVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvKeVSxV/pJ3l
+yRMHDtX08tgE4Wcoc48RgpZRCseVlUXO7ywVXZhUK/I025xhiID3FzhR8xsjvHWE
+a2tLc/rCHgXZDQzUXJg8kVQ9E4Ywy0wm2dymSafCygxNIjjuDWVQJupW/GTS8/IV
++q7cPWATikF1v1mdJFiMwtP6p1UFD27UupLw3GliGnKRsFJC6tDXDQqPam9eAAwo
+TKVbXwY+0UaahFUvUFUPFUyvZCk9uhj0o+LHtozeGbu5uUXlTtRnHcZsigAGgdMP
+25iH6ZaEXobjRYT1ZBSSQ+QRoxf2Ihoa7yQoKq5q7niMILt7C18jF2pHie7D85IP
+4i87eXnvdwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAAgI8wg4ocSH4tKAtFRH
+3GSajOxeBKb5rMwTQ5Hgf/ixYplSfCcDE96gdDvDP23BmUGlb/5Kv9KHLbFpMHoO
+tj72ADB+cej2QKjnCwUeG1dmFOLswO0X8u2FjEEG6m+hiHxfdrVk+yKWrcSt89MI
+bIavr8Kmz5vTLYOav2e3c7zLda00tokFELi/Gb76dJMSgPuOhLsoBXfKeSFlAzWE
+Fkv3GDyoXMd32wecrqJ/KqB30vRCZLMcipTvydTwSVL6VB2m6fKqLjF2Qjw0g/H1
+oNQacpOlVUI/QMPkv68vnESOzoIn5fCrsY7ivXaW6EtLfBUJR5+UVokQk/GSwrn7
+Q7I=
+-----END CERTIFICATE REQUEST-----
diff --git a/dgbuilder/certs/node-key.pem b/dgbuilder/certs/node-key.pem
new file mode 100644 (file)
index 0000000..c6f4491
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAvKeVSxV/pJ3lyRMHDtX08tgE4Wcoc48RgpZRCseVlUXO7ywV
+XZhUK/I025xhiID3FzhR8xsjvHWEa2tLc/rCHgXZDQzUXJg8kVQ9E4Ywy0wm2dym
+SafCygxNIjjuDWVQJupW/GTS8/IV+q7cPWATikF1v1mdJFiMwtP6p1UFD27UupLw
+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KBgGcMSyQKiSvFpZQ0JmKBpZC5CbFQ4OvJ5k1hejRP
+NKCmdqXktuKdwTp3VY6KVXDpZGSb3gqqAPIlRHVzsXezUqg2F0/FRAzSxvUrb/Bw
+oN8W139QkMBoZOgJPknZBZNbQXOgUupbP5LK+un2DcK1WTFpTSTV6E/OxIvZrAWC
+uZ9xAoGBAJufbS/h8Yo1sQMuIZEZhC6jFiPqA5fnIyQgaZu+zgpy3zjYXHpJ0THE
+wYZMEMKKxRFgZ7XXTWDkgdEfoJXMtnq/bN4BFxJ5Ns0FkitXmIc96+UYaKjC2KJK
+9TXMGe4bMJtFDhHZ0lzBqs0U88Yy/7AIupusuBnyupU5vLDUujh3
+-----END RSA PRIVATE KEY-----
index eff8485..fddb1a6 100755 (executable)
@@ -81,7 +81,8 @@ then
        echo "          'restConfUser': '$restConfUser'," >>$customSettingsFile
        echo "          'restConfPassword': '$restConfPassword'," >>$customSettingsFile
        echo "          'formatXML': '$formatXML'," >>$customSettingsFile
-       echo "          'formatJSON': '$formatJSON'" >>$customSettingsFile
+       echo "          'formatJSON': '$formatJSON'," >>$customSettingsFile
+       echo "          'enableHttps': true" >>$customSettingsFile
        echo "          }" >>$customSettingsFile
 fi
        #echo "Created custom settings  file $customSettingsFile"
index 14f6d38..460b2ef 100644 (file)
@@ -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) {
index 6fb04f0..a16a0eb 100644 (file)
@@ -40,5 +40,6 @@ module.exports={
     },
     "uiHost": "0.0.0.0",
     "version": "0.9.1",
-    "performGitPull": "N"
+    "performGitPull": "N",
+    "enableHttps" : true
 }
index f13efa0..bf2bd5b 100644 (file)
             <directory>tools</directory>
             <outputDirectory>dgbuilder/tools</outputDirectory>
         </fileSet>
+        <fileSet>
+            <directory>certs</directory>
+            <outputDirectory>dgbuilder/certs</outputDirectory>
+        </fileSet>
         <fileSet>
             <directory>yangFiles</directory>
             <outputDirectory>dgbuilder/yangFiles</outputDirectory>

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use