[helix-front] Read Certs passphrase from file

Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/3948840c
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/3948840c
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/3948840c

Branch: refs/heads/master
Commit: 3948840cacbdad0e96f528fb803c648a79d66579
Parents: 2b569db
Author: Vivo Xu <v...@linkedin.com>
Authored: Tue Aug 29 09:34:01 2017 -0700
Committer: Junkai Xue <j...@linkedin.com>
Committed: Mon Nov 6 17:07:13 2017 -0800

----------------------------------------------------------------------
 helix-front/server/app.ts    | 4 ++--
 helix-front/server/config.ts | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/3948840c/helix-front/server/app.ts
----------------------------------------------------------------------
diff --git a/helix-front/server/app.ts b/helix-front/server/app.ts
index 222b04f..141815f 100644
--- a/helix-front/server/app.ts
+++ b/helix-front/server/app.ts
@@ -40,8 +40,8 @@ if (SSL.port > 0 && fs.existsSync(SSL.keyfile) && 
fs.existsSync(SSL.certfile)) {
     ca: []
   };
 
-  if (SSL.passphrase) {
-    credentials.passphrase = SSL.passphrase;
+  if (fs.existsSync(SSL.passfile)) {
+    credentials.passphrase = fs.readFileSync(SSL.passfile, 'ascii').trim();
   }
 
   if (SSL.cafiles) {

http://git-wip-us.apache.org/repos/asf/helix/blob/3948840c/helix-front/server/config.ts
----------------------------------------------------------------------
diff --git a/helix-front/server/config.ts b/helix-front/server/config.ts
index d38f848..71cd9a2 100644
--- a/helix-front/server/config.ts
+++ b/helix-front/server/config.ts
@@ -8,6 +8,6 @@ export const SSL = {
   port: 0,
   keyfile: '',
   certfile: '',
-  passphrase: '',
+  passfile: '',
   cafiles: []
 };

Reply via email to