install ssl


  • | 481 points

    How can I install ssl on laragon and use my local url as "https://localhost:8000"? @leokhoa @condemned @codebyray


  • administrators
    | 122449 points


  • | 481 points

    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

    0_1535454987347_lara2.PNG
    0_1535454998401_lara.PNG


  • | 2354 points

    Hi @Muhammad-Yousaf

    if you want to use https://localhost
    you can edit this file
    C:\laragon\etc\apache2\sites-enabled\00-default.conf

    then 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.


  • administrators
    | 122449 points

    @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 to 8000,

    Then in your browser, you can access: https://localhost
    for your project, you should browser:
    https://allsocial.test


  • | 481 points

    @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"


  • | 481 points

    @leokhoa @mdennisa

    I 've don the steps
    but still there are some problems and it is not working properly. 0_1535535016468_port.PNG 0_1535535118722_privacy errors.PNG 0_1535535149595_ca4.PNG


  • administrators
    | 122449 points

    @Muhammad-Yousaf : Chrome may cache wrong cert. Just try another browser.

    If it doesn't work, try Menu > Apache > SSL > Add to Trust Store


  • | 481 points

    @leokhoa

    Now it is also giving me this ERROR . The httpd-ssl conf file is as
    0_1535536265424_error.PNG0_1535537390251_sslconf.PNG


  • | 481 points

    @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 !!!!!!!!!!!!!!0_1535623071689_https.PNG


  • administrators
    | 122449 points

    @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!


  • | 401 points

    @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.


  • | 707 points

    @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 the testsite.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?


  • administrators
    | 122449 points

    @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.


  • | 2354 points

    Hi @pixelbrad
    just in case you need specific SSL for https protocol in local development

    1. you can create a self signed-in certificate via https://certificatetools.com/
      add DNS for your local domain
    2. open cert.mgr, add your cert in trusted root certificate
    3. add your local domain to hosts file
    4. 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.


  • | 707 points

    Thank you for your replies, I'll try my luck with these solutions.


  • | 707 points

    @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.


  • | 2354 points

    @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 :)


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.