fbpx

Trust Laravel Homestead SSL Certificates

By default, Laravel Homestead generates a security certificate for all sites you register, allowing you to quickly develop via HTTPS on your local machine.

To get your browser to trust Homestead’s self-signed certificates, you have some options:

  1. Click through the privacy warning every time you visit a local site
  2. Add each generated certificate one by one (not sure this will persist through reprovisioning)
  3. Import Homestead’s root CA to your browser’s trusted authorities

The last one is by far the most long-term solution, and it’s dead simple if you know what you’re doing.

Add Homestead’s CA to Trusted Certificates

These instructions are specific to Chrome, but adding a certificate to other browsers should just be quick Google search away.

The gist is to grab the root CA file from the Homestead Vagrant box, copy it somewhere you can get to it, and import it into Chrome.

  1. First, ssh into your running Vagrant machine
  2. Navigate to /etc/nginx/ssl
  3. Copy ca.homestead.homestead.crt from this directory into a directory configured to be shared by your host machine and guest VM (mine happens to be home/vagrant/dev, so cp ca.homestead.homestead.crt /home/vagrant/dev)
  4. Open Chrome’s settings (via the menus or just visit chrome://settings in the navigation bar
  5. Pop open the “Advanced” settings
  6. Click “Manage certificates / Manage HTTPS/SSL certificates and settings”. This will open a new window
  7. Start the Import process, and browse for that file we just copied over
  8. When selecting the certificate store on the next screen or so, use “Place all certificates in the following store”. Browse, and select “Trusted Root Certification Authorities”
  9. Finish, and restart Chrome (chrome://restart in the navigation bar)

And you’re set! Should be able to visit your various local sites using https without issues.

Steps 1-3 will get you started for any browser (or your OS itself), and you should be able to find instructions specific to your browser for actually importing.


Are You a Do-It-Yourself WordPress-er?

If you aren't ready to invest in Sterner Stuff, I've got something for you! Check out my new (and free) WordPress for Small Business Owners email course!

Leave a reply

Your email address will not be published. Required fields are marked *