Skip to content

Instantly share code, notes, and snippets.

@richarddewit
Last active December 27, 2018 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richarddewit/0cf5b27b531a52bde2dbe2725d464bf7 to your computer and use it in GitHub Desktop.
Save richarddewit/0cf5b27b531a52bde2dbe2725d464bf7 to your computer and use it in GitHub Desktop.

How to trust a local development Root CA

(this guide focuses on Laravel's development server, Homestead)

For example; Homestead by default creates SSL certificates for your local websites, however you have to always click "Proceed/Trust/Make exception" or trust every website's certificate manually before being able to visit the site. By installing the Root CA (roughly: the certificate which is used to create the website certificates), you instantly trust all certificates that are derived from it.

Getting the Root CA

Normally on an Nginx webserver (e.g. on Homestead) the certificates are stored in the /etc/nginx/ssl folder. You see all the certificates that are generated for your local websites, including 3 crucial files:

  • ca.homestead.homestead.cnf
  • ca.homestead.homestead.crt
  • ca.homestead.homestead.key

We are only going to need the .crt file. Download it somewhere:

scp vagrant@192.168.10.10:/etc/nginx/ssl/ca.homestead.homestead.crt ~/Downloads/ca.homestead.homestead.crt

Trusting the certificate

Arch/Manjaro Linux

sudo trust anchor --store ~/Downloads/ca.homestead.homestead.crt
sudo update-ca-trust

Windows

  • Double-click the file
  • Click Install Certificate... button
  • Select Current User and click Next
  • Select Place all certificates in the following store and click Browse...
  • Select Trusted Root Certification Authorities and click OK
  • Click Next
  • Click Finish

Firefox

Firefox initially doesn't care about your OS's certificate store, so you have to force it:

  • Go to about:config
  • Read and accept warning
  • Search for security.enterprise_roots.enabled and set it to true

Firefox on Linux

  • Go to > Preferences > Privacy & Security
  • Under Security > Certificates (at the botom) click the Security devices... button
  • In the popup, click the Load button
  • In Module Name insert p11-kit-trust
  • In Module filename insert the path of p11-kit-trust.so
    • You can find this by executing locate p11-kit-trust.so in your terminal
  • Click OK and OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment