diff options
author | eeginux <henry.xie@est.tech> | 2020-02-18 10:54:48 +0000 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-02-20 14:26:10 +0000 |
commit | 1094dd5be7b0b2d0a227084afdb15ea43a574934 (patch) | |
tree | 7eeeb1f9aceea7ec2d238d3e451f186a77caf4ee /cds-ui/server/index.js | |
parent | 369ede4108a770ceb9639c6009f732ebce9be836 (diff) |
Update certifcate
Change to use p12 file and password
Issue-ID: CCSDK-706
Change-Id: Idbc4ba392c4c6244a501f22e3e591f1256806eba
Signed-off-by: eeginux<henry.xie@est.tech>
Diffstat (limited to 'cds-ui/server/index.js')
-rw-r--r-- | cds-ui/server/index.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cds-ui/server/index.js b/cds-ui/server/index.js index 161a18be7..be6a3b77f 100644 --- a/cds-ui/server/index.js +++ b/cds-ui/server/index.js @@ -25,12 +25,26 @@ const fs = require('fs') module.exports = application; if (require.main === module) { + + try { + var p12File = process.env.KEYSTORE || "aaf.p12" + var passwdFile = process.env.PASSPHRASE || ".enc" + + var data = fs.readFileSync(passwdFile, 'utf8') + var elements = data.match(/cadi_keystore_password_p12=(.*)\n/) + var passphrase = elements[1] + var p12 = fs.readFileSync(p12File) + } catch(e){ + console.error('Reading keystore error :', e) + process.exit(11) + } + // Run the application const config = { rest: { protocol: 'https', - key: fs.readFileSync('server.key'), - cert: fs.readFileSync('server.cert'), + pfx: p12, + passphrase: passphrase, port: +process.env.PORT || 3000, host: process.env.HOST || 'localhost', openApiSpec: { |