Skip to content

Commit fbd85de

Browse files
committed
Support pfx passphrase
1 parent 223ae23 commit fbd85de

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/server/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ var utils = {
2121
},
2222
/**
2323
* @param filePath
24+
* @param passphrase
2425
* @returns {{pfx}}
2526
*/
26-
getPFX: function (filePath) {
27+
getPFX: function (filePath, passphrase) {
2728
return {
28-
pfx: fs.readFileSync(filePath)
29+
pfx: fs.readFileSync(filePath),
30+
passphrase: passphrase,
2931
};
3032
},
3133
/**
@@ -36,8 +38,9 @@ var utils = {
3638
server: (function () {
3739
if (options.get("scheme") === "https") {
3840
var pfxPath = options.getIn(["https", "pfx"]);
41+
var pfxPassphrase = options.getIn(["https", "pfxPassphrase"]);
3942
return pfxPath ?
40-
https.createServer(utils.getPFX(pfxPath), app) :
43+
https.createServer(utils.getPFX(pfxPath, pfxPassphrase), app) :
4144
https.createServer(utils.getKeyAndCert(options), app);
4245
}
4346
return http.createServer(app);

0 commit comments

Comments
 (0)