install ssl
-
How can I install ssl on laragon and use my local url as "https://localhost:8000"? @leokhoa @condemned @codebyray
-
@Muhammad-Yousaf Just use Laragon 3.3+:
https://forum.laragon.org/topic/1028/laragon-3-3-released-automated-ssl-certificates-auto-detect-generate-and-add-to-trust-store
-
I have updated my laragon version. but still its not working for me . You can see in the attachment. It still starts as "http;//localhost:8000" @leokhoa
-
if you want to use https://localhost
you can edit this file
C:\laragon\etc\apache2\sites-enabled\00-default.confthen add virtual host to detect port 443 (ssl)
example:<VirtualHost default:443>
<Directory "C:/laragon/www/">
AllowOverride All
Require all granted
</Directory>SSLEngine on SSLCertificateFile C:/laragon/etc/ssl/laragon.crt SSLCertificateKeyFile C:/laragon/etc/ssl/laragon.key
</VirtualHost>
the setting above might need to be adjusted to your setup.
But not sure if you want https on port 8000, maybe you can change the port to 8000 for ssl and possibly require more adjustment on another ssl setting.
-
@Muhammad-Yousaf : Why did you use
php artisan serve
? It will not work.From the image, your Apache still served on port
443
, just change the HTTPS port in Menu > Ports & Services to8000
,Then in your browser, you can access: https://localhost
for your project, you should browser:
https://allsocial.test
-
@mdennisa said
Actually I have to use facebook oauth api to login the users. but every time i make a call they send an error "Insecure login blocked" this is due to i'm sending the request from "HTTP" and not "HTTPS". That is the reason I have to change my url from "http://localhost" to "https://localhost"
-
I 've don the steps
but still there are some problems and it is not working properly.
-
@Muhammad-Yousaf : Chrome may cache wrong cert. Just try another browser.
If it doesn't work, try Menu > Apache > SSL > Add to Trust Store
-
Now it is also giving me this ERROR . The httpd-ssl conf file is as
-
@leokhoa @mdennisa
Thanks alot you guys. finally I have done it. Actually I was using laragon in really old fashion way like wamp or xammp by running ('PHP artisan serve') but in the en finally i get it. Laragon is really cooool!!!!!!!!!!!
-
@Muhammad-Yousaf : I am so glad to hear you sorted it out!
Yes, you'll find no system is easy to like Laragon - especially the SSL feature : )
Cheers!
-
@leokhoa but i have done nothing else except replace the files from ssl directory and still nothing. what can i do to make it work? i even restarted the pc and apache but no success. this after i send it to trusted store. i have letsencrypt wildcard keys.
-
@leokhoa I'm having some trouble here, too. I've been able to get SSL working for
https://localhost
, but not for any of the sites I actually work on. I've enabled SSL via Laragon's menu, and I've added the certificate to the trust store.When I'm working on a site locally, I like to have it setup with its own domain. So I add an entry to my
hosts
file, and I setup the vhost in my Apache vhosts conf file.Hosts file:
127.0.0.1 testsite.local
Vhosts conf file:
<VirtualHost *:80> DocumentRoot "C:\laragon\www\testsite" ServerName testsite.local ErrorLog "C:\laragon\log\apache\sites\testsite.local_error.log" CustomLog "C:\laragon\log\apache\sites\testsite.local_access.log" common </VirtualHost> <VirtualHost *:443> DocumentRoot "C:\laragon\www\testsite" ServerName testsite.local ErrorLog "C:\laragon\log\apache\sites\testsite.local_error.ssl.log" CustomLog "C:\laragon\log\apache\sites\testsite.local_access.ssl.log" common SSLEngine on SSLCertificateFile C:/laragon/etc/ssl/laragon.crt SSLCertificateKeyFile C:/laragon/etc/ssl/laragon.key </VirtualHost>
But when I open up
https://testsite.local
, I get an error message:NET::ERR_CERT_COMMON_NAME_INVALID
Which I guess makes sense, as I'm guessing the SSL certificate Laragon comes with is intended to be used for the
localhost
domain, and not thetestsite.local
domain.I have the option 'Auto virtual hosts' disabled for my own reasons, but I'd still like to setup sites locally to use SSL (especially when I'm working on an e-commerce site). Can I generate SSL certificates somehow? And how would I add my own certificates to the trust store?
-
@pixelbrad : Laragon can help you have SSL for
localhost
and other local domains. Because you disable "Auto virtual hosts", some automation fuctions did not work.
You can enable it again to let it solves the SSL issue for you, then disable it.
-
Hi @pixelbrad
just in case you need specific SSL for https protocol in local development- you can create a self signed-in certificate via https://certificatetools.com/
add DNS for your local domain - open cert.mgr, add your cert in trusted root certificate
- add your local domain to hosts file
- test in your browser using https://
for a side note,
when you activate SSL via Laragon, it will automate all the process in your PC.
- you can create a self signed-in certificate via https://certificatetools.com/
-
Thank you for your replies, I'll try my luck with these solutions.
-
@mdennisa Thank you for linking me to that tool. Complete game-changer right there. Not only did that work for me, I can share this with the rest of my team, including those who aren't on Windows.
-
@pixelbrad
Glad to hear that.it will be different to set it up on mac os x though, but I think you can do it on your own
big thanks to Laragon founder, I'm just helping the community who loves Laragon