Laravel Homestead SSL

Self Signed certificates:

Homestead creates certificates for all the sites, and also creates 1 certificate for itself.

To make SSL work on a homestead site you have to open Certmgr (or search for Certificates in windows start screen):

Copy certificates to a folder accessible to windows explorer
cp -r /etc/nginx/ssl /home/vagrant/code/ssl

1. Import ca.homestead.homestead.crt to Personal / Trusted Root Certificate Authorities
* If you have multiple Homestead machines, you have to rename the ca.homestead.homestead.crt file to something else, otherwise it will say it's already installed.

2. Import site.tld.crt to Personal / Trusted Root Certificate Authorities




Close certmgr and chrome. The certificate will only work after the restart of chrome.


3. To make firefox work: Options \ View Certificates - Authorities tab and import ca.homestead.homestead.crt

If you get this error: "This personal certificate can't be installed because you do not own the corresponding private key which was created when the certificate was requested."

Run this in the ssl folder (from windows)

openssl pkcs12 -export -in ca.homestead.homestead.crt -inkey ca.homestead.homestead.key -out server.p12

It will generate a key named server.p12 that can be installed by Firefox.


At this point, the certificate authority "Homestead" is trusted, therefore all the certificates generated by this authority will be trusted.

SSL should work now.


Comments

Popular posts from this blog

Laravel Reverb + Echo naming convention.