Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verifying a self-signed certificate on local Laravel Homestead server

I followed the following details on creating an SSL certificate, so I can run local test sites via Laravel's Homestead, using https.

Adding https cert on homestead vm

All is well but when viewing the test domain over https://, I get a red cross on Chrome's address bar. It says that the certificate is untrusted due to being self-signed and not verified by third-party.

Is there a way that I can sort this out? So that I can get my HTTPS local domains to be trusted by Chrome and work as if online?

like image 352
Simon Davies Avatar asked Oct 19 '25 04:10

Simon Davies


2 Answers

Chrome does not allow you to export the certificate anymore. You need to either use another browser that supports this feature (e.g. firefox) or just simply copy the generated certificate to the shared directory from your homestead machine, so then you can import and trust it in the keychain.

# where I share all homestead certs with the host machine
mkdir /home/vagrant/Code/.certs/

cp -vf /etc/nginx/ssl/homestead.app.cert /home/vagrant/Code/.certs

On your local host machine, open the certificate file and import it to the System keychain. Once imported, open it and set its trust level to "Always trust".

Set the trust level to "Always trust"

Restart Chrome and you're done.

like image 73
sepehr Avatar answered Oct 21 '25 20:10

sepehr


You have to trust your self signed certificate in chrome to remove the "red cross" message.

There are several tutorials how to trust a self signed certificate in chrome: See https://stackoverflow.com/a/18602774/3219613 for example.

like image 37
Pᴇʜ Avatar answered Oct 21 '25 19:10

Pᴇʜ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!