Skip to content

Commit

Permalink
docs(configuration): update devServer.https (#5643)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Oct 30, 2021
1 parent 7c70871 commit 8464279
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/content/configuration/dev-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ npx webpack serve --http2 --https-key ./path/to/server.key --https-cert ./path/t

`boolean` `object`

By default, dev-server will be served over `HTTP`. It can optionally be served over `HTTP/2` with `HTTPS`:
By default, dev-server will be served over `HTTP`. It can optionally be served over `HTTPS`:

**webpack.config.js**

Expand Down Expand Up @@ -662,10 +662,10 @@ With the above setting, a self-signed certificate is used, but you can provide y
module.exports = {
devServer: {
https: {
ca: './server.pem',
pfx: './server.pfx',
key: './server.key',
cert: './server.crt',
ca: './path/to/server.pem',
pfx: './path/to/server.pfx',
key: './path/to/server.key',
cert: './path/to/server.crt',
passphrase: 'webpack-dev-server',
requestCert: true,
},
Expand All @@ -678,7 +678,7 @@ This object is passed straight to the Node.js HTTPS module, so see the [HTTPS do
To pass your own certificate via the CLI use the following options:

```bash
npx webpack serve --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-ca ./path/to/ca.pem
npx webpack serve --https-request-cert --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-ca ./path/to/ca.pem --https-pfx ./path/to/server.pfx --https-passphrase webpack-dev-server
```

`webpack-dev-server >= v4.2.0` allows you to set additional [TLS options](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) like `minVersion`. Also, you can directly pass the contents of respective files:
Expand Down

1 comment on commit 8464279

@vercel
Copy link

@vercel vercel bot commented on 8464279 Oct 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.