Skip to content

How to get the "green padlock" using the built in certificate

Lloyd Brookes edited this page Nov 2, 2017 · 10 revisions

Tested on Chrome on macOS. Feel free to add instructions to this page for Windows, Linux or other browsers.

Locate the built-in certificate

Possible locations:

  • local-web-server installed globally
    • /usr/local/lib/node_modules/local-web-server/node_modules/lws/ssl/lws-cert.pem
  • local-web-server installed locally
    • ./node_modules/lws/ssl/lws-cert.pem

Trust the certificate (macOS)

You must add the new certificate to your machine's trusted certificate store. On macOS, this is done via the Keychain Assistant.

  1. Open Keychain Assistant
  2. Import the certificate
  3. Open it and select "Always trust"

Launch the secure server

$ 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.

Clone this wiki locally