Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the SSL certificate and key configurable for localhost #4050

Closed
jackpetraitis opened this issue Feb 21, 2018 · 6 comments · Fixed by #5845
Closed

Make the SSL certificate and key configurable for localhost #4050

jackpetraitis opened this issue Feb 21, 2018 · 6 comments · Fixed by #5845

Comments

@jackpetraitis
Copy link

I want to be able to provide self-signed certs and keys to my app during localhost development. These files need to be passed to the webpack-dev-server that runs behind the scenes when I do the "npm start" script from this package.

There are many ways to sign your own SSL certificate, and I know webpack-dev-server has the ability to run https over its own self-signed certificate.

However, this doesn't meet my request. I also know that the webpack-dev-server can take in key and cert file locations as arguments, and that is what my issue is targeting. I think we should add the ability to configure certificate and key file locations. This will make any development requiring SSL on localhost more straightforward.

How could we go about doing that?

I think there are two options:

  • Make them optional command-line arguments for the "npm start" script, configurable in package.json
  • Make the keys and certs follow a common naming convention or possibly use a certain folder structure
@rlueder
Copy link
Contributor

rlueder commented Apr 9, 2018

For anyone landing here looking for custom HTTPS certificates setup, react-app-rewired solved it: https://github.com/timarney/react-app-rewired#extended-configuration-options

@ssylvia
Copy link

ssylvia commented Jun 6, 2018

This would be really nice. I want to be able to add my development certificate as a trusted certificate to keychain so I don't get browser security warnings. I can do that now, but there are various situations that the webpack generated certificate will get deleted so I have to remove the old certificate from keychain and trust a new certificate.

@Fordi
Copy link

Fordi commented Oct 26, 2018

This has been in the pipeline this long?

I don't get it. You provide a simple endpoint for proxy configuration, why not an endpoint of configuration of the larger webpack server?

I'll be back shortly with a PR.

@goldylucks
Copy link

@rlueder were you able to get it to work in CRA2? React-app-rewired only supports CRA1, and there's no plugin available in https://github.com/arackaf/customize-cra

@rlueder
Copy link
Contributor

rlueder commented May 28, 2019

@goldylucks there's actually an easier way described here: #6126 (comment)

@goldylucks
Copy link

@rlueder thanks man, that worked like a charm!

@lock lock bot locked and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants