Getting Started

Summary: This post helping you to convert http to https on your local machine. Now a day most social login integration required https url to integrated social login on our website. So if you want to integrate social login for testing purpose you need to have https

If you have a website-demo.dev defined in your Homestead.yaml, then if you go in /etc/nginx/ssl/ you will find two files for your domain:

website-demo.dev.key

website-demo.dev.crt

 

All you have to do is (if you are on Mac OS) is get this website website-demo.dev.crt inside your Keychain Access, and set to trust this certificate. 
 
 In order to use this file, you can vagrant ssh and copy this file to your shared folder:

sudo cp /etc/nginx/ssl/website-demo.dev.crt /home/vagrant/Code/ssl

Now you can access this file from your Mac OS (wherever you setup your source folder).

KeyChain image mac os

Then below the All Items, click on Certificates, and find your website-demo.dev.crt

Then double click on it and select to Trust -> Always trust. 
 
 And that’s it. Now your setup is closer to what you should have on your production and can operate on HTTPS.

Also you may want to have a permanent redirection from http to https

This should be placed at the top of

sudo vim /etc/nginx/sites-available/website-demo.app
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name website-demo.app;
return 301 https://website-demo.app;
}

 

Reference post : how-to-setup-https-with-laravel-homestead-ad7915470fa8

Comments

Sign in to publish a comment

1 comment

Vishnu Sharma commented on
Nov 1, 2018, 11:13 PM

Good one!