-
Notifications
You must be signed in to change notification settings - Fork 87
How to get the "green padlock" using the built in certificate
These instructions apply to Google Chrome. If you spot any mistakes please correct them.
If local-web-server is installed globally.
-
/usr/local/lib/node_modules/local-web-server/node_modules/lws/ssl/lws-cert.pem
.
If local-web-server is installed locally.
./node_modules/lws/ssl/lws-cert.pem
If you're using nvm
(Node Version Manager).
$ nvm which current
-
$ open
that directory - Follow back that directory until you get to your active version directory (
v#.##.#
) - Go to
./lib/node_modules/local-web-server/node_modules/lws/ssl
If you're using the default NVM install location, you can also just run:
$ open ~/.nvm/versions/node/v8.11.1/lib/node_modules/local-web-server/node_modules/lws/ssl/
You must add the certificate to your machine's trusted certificate store via the Keychain Assistant.
- Open Keychain Assistant
- Import the certificate
- Open it and select "Always trust"
$ 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.
If local-web-server is installed globally.
-
/usr/local/lib/node_modules/local-web-server/node_modules/lws/ssl/lws-cert.pem
.
If local-web-server is installed locally.
./node_modules/lws/ssl/lws-cert.pem
If you're using nvm
(Node Version Manager).
$ nvm which current
-
$ open
that directory - Follow back that directory until you get to your active version directory (
v#.##.#
) - Go to
./lib/node_modules/local-web-server/node_modules/lws/ssl
If you're using the default NVM install location, you can also just run:
$ open ~/.nvm/versions/node/v8.11.1/lib/node_modules/local-web-server/node_modules/lws/ssl/
Follow the instructions at https://leehblue.com/add-self-signed-ssl-google-chrome-ubuntu-16-04/ to trust a certificate on Ubuntu.
$ 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.
If local-web-server is installed globally.
-
%AppData%\npm\node_modules
on Windows 7+
If local-web-server is installed locally.
./node_modules/lws/ssl/lws-cert.pem
Follow the instructions at http://www.nullalo.com/en/chrome-how-to-install-self-signed-ssl-certificates/.
- 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.