From 901a5bdac1d10d77ade04ad6d6e5cfd979c93451 Mon Sep 17 00:00:00 2001 From: thisIsTheFoxe Date: Sat, 30 May 2020 19:47:34 +0200 Subject: [PATCH] added passphase to credential-options --- README.md | 1 + lib/core.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 96b5348..a4cf070 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,7 @@ An example of the `https` or `spdy` option. { cert: 'path/to/cert.pem', key: 'path/to/key.pem', + passphrase: '', ca: 'path/to/ca.pem' } ``` diff --git a/lib/core.js b/lib/core.js index 8aed9c1..556791c 100644 --- a/lib/core.js +++ b/lib/core.js @@ -74,6 +74,10 @@ core.createServer = function (options) { cert: fs.readFileSync(serverOptions.cert) }; + if (serverOptions.passphrase) { + credentials.passphrase = serverOptions.passphrase; + } + if (serverOptions.ca) { serverOptions.ca = !Array.isArray(serverOptions.ca) ? [serverOptions.ca]