Add requestCert support to the server #1029
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add this configuration flag to request a client's certificate for 2-way PKI authentication.
Issue #1011
The motivation for this feature proposal is to allow create-react-app to enable the instance of webpack-dev-server to request the client certificate for 2-way PKI auth.
The issue actually doesn't lie in webpack-dev-server itself (configuration is much easier when using webpack-dev-server by itself), but rather that create-react-app only sends a boolean to webpack-dev-server. Here is the line I am referencing: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/config/webpackDevServer.config.js#L81
From what I can tell, this means that the configuration options for webpack-dev-server are limited to the key, cert, ca, and passphrase when using create-react-app. Minimizing configuration seems to be create-react-app's goal (which I totally understand) but a feature like this would be nice to have in development.
I simply just added the requestCert field to the configuration if webpack-dev-server receives https as a boolean rather than an object. Defaults to false if it is no specified.