Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

minaFaragAmin's avatar

how to add SSL to my localhost homestead ?

am trying hard to add ssl to my homestead vagrant machine and make it listen to 80 and 44300 ports ? but couldn't do that , Anyhelp please ?

0 likes
6 replies
Cronix's avatar

ssl is enabled by default. All you should have to do is visit the https version of the url (as well as have all assets in your views being loaded via https so you don't get mixed-content errors). It's a self signed certificate, so you will probably have to accept it in your keychain to avoid browser warnings, etc. Homestead already redirects the ports appropriately. Just access it.

1 like
minaFaragAmin's avatar

@CRONIX - i've tried it over https and http as you described and it's working correctly thanks alot. the thing that is yet annoying to me is the google chrome warnings.

if i saved the self signed certificate would it be secured to test payment-gateways on my machine

Cronix's avatar

@MINAFARAGAMIN - I don't use Chrome anymore so can't help with that part, but in Firefox you can add a permanent exception to that warning and never see it again for that site. There's a warning that pops up where you can accept it.

Google "chrome permanently accept self signed certificate" or something.

1 like
JoshuaAllman's avatar

Go to your terminal

CD into your local_site folder

Type; valet secure

Viola

Please or to participate in this conversation.