From fbd85deccf8bf46ac3b7cb83283e61963243f177 Mon Sep 17 00:00:00 2001 From: Jakob Hedman Date: Fri, 8 Jan 2016 16:34:29 +0100 Subject: [PATCH] Support pfx passphrase --- lib/server/utils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/server/utils.js b/lib/server/utils.js index b8c9a8fa8..dee07aace 100644 --- a/lib/server/utils.js +++ b/lib/server/utils.js @@ -21,11 +21,13 @@ var utils = { }, /** * @param filePath + * @param passphrase * @returns {{pfx}} */ - getPFX: function (filePath) { + getPFX: function (filePath, passphrase) { return { - pfx: fs.readFileSync(filePath) + pfx: fs.readFileSync(filePath), + passphrase: passphrase, }; }, /** @@ -36,8 +38,9 @@ var utils = { server: (function () { if (options.get("scheme") === "https") { var pfxPath = options.getIn(["https", "pfx"]); + var pfxPassphrase = options.getIn(["https", "pfxPassphrase"]); return pfxPath ? - https.createServer(utils.getPFX(pfxPath), app) : + https.createServer(utils.getPFX(pfxPath, pfxPassphrase), app) : https.createServer(utils.getKeyAndCert(options), app); } return http.createServer(app);