@squaredle/local-ssl-certs
v1.1.3
Published
Generate self-signed root CA certificates and sign SSL certs for local development, permanently bypassing annoying HTTPS warnings.
Maintainers
Readme
Dev Certificates
Easy creation of local trusted SSL certificates for developers.
Quickstart
npx @squaredle/local-ssl-certs issue --name Acme dev-certs acme.test "*.acme.test"Usage
Run:
npx @squaredle/local-ssl-certs issue --name Acme dev-certs acme.testInstall the resulting CA certificates:
The root CA certificate (ending in
.crt) must be installed in your Trusted Root Certification Authorities store.- By default, the root CA's private key is deleted after creation so it can't be used against you.
The intermediate CA (also ending in
.crt) must be installed in your Intermediate Certification Authorities store.- This certificate can only be used to sign certificates for
.testdomain names, so it's relatively safe to keep the private key around. - Alternatively, you may delete the intermediate private key, but you'll need to reissue and reinstall the root and intermediate CA certificates to generate new certificates later.
- This certificate can only be used to sign certificates for
Installation varies by OS:
Windows: Open the root and intermediate
.crtfiles and install each in its appropriate store (see above).Mac: Open the root and intermidate
.crtfiles in Keychain Access and install them in the System keychain, set to "Always Trust".Linux: Varies by distribution. For Ubuntu:
sudo cp dev-certs/root-ca.crt /usr/local/share/ca-certificates/ sudo update-ca-certificates
Configure your local web server to use the generated certificate and key:
For example, if you're using
http-server:npx http-server -S -C dev-certs/your-local-domain.test.crt -K dev-certs/your-local-domain.test.keyOr in an Apache VirtualHost:
SSLEngine on SSLCertificateFile /path/to/dev-certs/your-local-domain.test.crt SSLCertificateKeyFile /path/to/dev-certs/your-local-domain.test.key
Test the SSL certificate:
- You may need to restart your browser or device for new CAs to take effect.
- Open your browser and navigate to
https://your-local-domain.test. - If everything is set up correctly, you should see a secure connection without any warnings.
