Skip to content

Commit 78c519e

Browse files
JakeHedmanshakyShane
authored andcommitted
Support pfx passphrase
2 parents d979876 + fbd85de commit 78c519e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

lib/server/utils.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ var serverUtils = {
3333
},
3434
/**
3535
* @param filePath
36+
* @param passphrase
3637
* @returns {{pfx}}
3738
*/
38-
getPFX: function (filePath) {
39+
getPFX: function (filePath, passphrase) {
3940
return {
40-
pfx: fs.readFileSync(filePath)
41+
pfx: fs.readFileSync(filePath),
42+
passphrase: passphrase,
4143
};
4244
},
4345
/**
@@ -52,8 +54,9 @@ var serverUtils = {
5254

5355
if (options.get("scheme") === "https") {
5456
var pfxPath = options.getIn(["https", "pfx"]);
57+
var pfxPassphrase = options.getIn(["https", "pfxPassphrase"]);
5558
return pfxPath ?
56-
httpModule.createServer(serverUtils.getPFX(pfxPath), app) :
59+
httpModule.createServer(serverUtils.getPFX(pfxPath, pfxPassphrase), app) :
5760
httpModule.createServer(serverUtils.getKeyAndCert(options), app);
5861
}
5962

@@ -192,10 +195,6 @@ var serverUtils = {
192195
return item;
193196
}
194197
}
195-
196-
/**
197-
* Add the proxy Middleware to the end of the stack
198-
*/
199198
},
200199
getBaseApp: function (bs) {
201200

0 commit comments

Comments
 (0)