-
Notifications
You must be signed in to change notification settings - Fork 91
How to get the "green padlock" using the built in certificate
Benny Powers edited this page Feb 25, 2018
·
10 revisions
Tested on Chrome on macOS. Feel free to add instructions to this page for Windows, Linux or other browsers.
Possible locations:
- local-web-server is installed globally
-
/usr/local/lib/node_modules/local-web-server/node_modules/lws/ssl/lws-cert.pem
on macOS and Linux. -
%AppData%\npm\node_modules
on Windows 7+
-
- local-web-server is installed locally
./node_modules/lws/ssl/lws-cert.pem
You must add the new certificate to your machine's trusted certificate store. On macOS, this is done via the Keychain Assistant.
- Open Keychain Assistant
- Import the certificate
- Open it and select "Always trust"
Follow the instructions at http://www.nullalo.com/en/chrome-how-to-install-self-signed-ssl-certificates/ tl;dr:
- Start your local web server in https mode and browse to the site
- Click
Advanced > Proceed to localhost (unsafe)
- Press F12 to open dev tools
- Click on the security tab, then click on
View Certificate
- Click the details tab then
Copy to File
- Click "Next", then
Cryptographic Message Syntax Standard – PKCS #7 Certificates (.P7B)
, then "Next" again - Save the certificate somewhere accessible, like the Desktop
- Open
Chrome Settings
>Show advanced settings…
>HTTPS/SSL
>Manage certificates…
>Import
- Click "Next", browse to the certificate you exported in step 7.
- Click "Place all certificates in the following store", then click "Browse" and select
Trusted Root Certification Authorities
. - Click "OK", then "Next", then "Finish"
- Restart Chrome
$ ws --https
Serving at https://mbp.local:8000, https://127.0.0.1:8000, https://192.168.0.100:8000
If you navigate to https://127.0.0.1:8000
you will now see the green lock.