Creates a proxy to your HTTP app with HTTPS, using provided certificate files. This is designed as a convenience.
You'll need to generate a self-signed certificiate, or one from a locally trusted CA.
The mkcert package, available on Homebrew, is very easy to use.
- Ensure you have Homebrew installed.
- Run
brew install mkcert nss.mkcertwill create the certificate.nsswill get Firefox to recognize it. (Other browsers will recognize it automatically.) - Change to the directory where you'd like to save the certificates. I recommend a
/certificatesdirectory in your project. - Run
mkcert localhost. - Ensure that the two generated files,
localhost.pemandlocalhost-key.pem, are ignored in your source control.
Contributions welcome!
In parallel with your development environment, run this as follows:
https-cert-proxy --cert path/to/localhost.pem --key path/to/localhost-key.pemI find it easiest to have these scripts in my package.json, using the package concurrently:
{
"scripts": {
"dev": "concurrently -n w: npm:dev-*",
"dev-web": "YOUR CURRENT DEV SCRIPT",
"dev-ssl": "https-cert-proxy --cert path/to/localhost.pem --key path/to/localhost-key.pem"
},
"devDependencies": {
"concurrently": "^5.1.0",
"https-cert-proxy": "^0.0.1"
}
}Copyright (c) 2020 Todd Dukart. Licensed under the BSD-3-Clause.