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:
- Click through the privacy warning every time you visit a local site
- Add each generated certificate one by one (not sure this will persist through reprovisioning)
- 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.
- First, ssh into your running Vagrant machine
- Navigate to
ca.homestead.homestead.crtfrom this directory into a directory configured to be shared by your host machine and guest VM (mine happens to be
cp ca.homestead.homestead.crt /home/vagrant/dev)
- Open Chrome’s settings (via the menus or just visit
chrome://settingsin the navigation bar
- Pop open the “Advanced” settings
- Click “Manage certificates / Manage HTTPS/SSL certificates and settings”. This will open a new window
- Start the Import process, and browse for that file we just copied over
- 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”
- Finish, and restart Chrome (
chrome://restartin 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.