Skip to content

Commit

Permalink
Support pfx passphrase
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeHedman authored and shakyShane committed Nov 20, 2016
2 parents d979876 + fbd85de commit 78c519e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/server/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ var serverUtils = {
},
/**
* @param filePath
* @param passphrase
* @returns {{pfx}}
*/
getPFX: function (filePath) {
getPFX: function (filePath, passphrase) {
return {
pfx: fs.readFileSync(filePath)
pfx: fs.readFileSync(filePath),
passphrase: passphrase,
};
},
/**
Expand All @@ -52,8 +54,9 @@ var serverUtils = {

if (options.get("scheme") === "https") {
var pfxPath = options.getIn(["https", "pfx"]);
var pfxPassphrase = options.getIn(["https", "pfxPassphrase"]);
return pfxPath ?
httpModule.createServer(serverUtils.getPFX(pfxPath), app) :
httpModule.createServer(serverUtils.getPFX(pfxPath, pfxPassphrase), app) :
httpModule.createServer(serverUtils.getKeyAndCert(options), app);
}

Expand Down Expand Up @@ -192,10 +195,6 @@ var serverUtils = {
return item;
}
}

/**
* Add the proxy Middleware to the end of the stack
*/
},
getBaseApp: function (bs) {

Expand Down

0 comments on commit 78c519e

Please sign in to comment.