Skip to content

Commit 490fbce

Browse files
meltuhamySpaceK33z
authored andcommitted
Add support for pfx files as ssl connection options (#630)
1 parent b0748c8 commit 490fbce

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

bin/webpack-dev-server.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ var optimist = require("optimist")
3939

4040
.string("cacert").describe("cacert", "Path to a SSL CA certificate.")
4141

42+
.string("pfx").describe("pfx", "Path to a SSL pfx file.")
43+
44+
.string("pfx-passphrase").describe("pfx-passphrase", "Passphrase for pfx file.")
45+
4246
.string("content-base").describe("content-base", "A directory or URL to serve HTML content from.")
4347

4448
.string("content-base-target").describe("content-base-target", "Proxy requests to this target.")
@@ -152,6 +156,12 @@ if(argv["key"])
152156
if(argv["cacert"])
153157
options.ca = fs.readFileSync(path.resolve(argv["cacert"]));
154158

159+
if(argv["pfx"])
160+
options.pfx = fs.readFileSync(path.resolve(argv["pfx"]));
161+
162+
if(argv["pfx-passphrase"])
163+
options.pfxPassphrase = argv["pfx-passphrase"];
164+
155165
if(argv["inline"])
156166
options.inline = true;
157167

lib/Server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ function Server(compiler, options) {
288288
options.https = {
289289
key: options.key,
290290
cert: options.cert,
291-
ca: options.ca
291+
ca: options.ca,
292+
pfx: options.pfx,
293+
passphrase: options.pfxPassphrase
292294
};
293295
}
294296

0 commit comments

Comments
 (0)