1

I googled a lot about solution to serve with https. Even I tried ngrok, but it doesn't work properly. Below is the code of ngork.

php artisan serve
cd <path-to-ngrok>
./ngrok http localhost:8000

I am sure Laravel has artisan to serve HTTPS.

Tom Keller
  • 91
  • 1
  • 12
  • I understand this is one general question, but still finding solution. – Tom Keller Nov 02 '20 at 13:04
  • 2
    The built-in webserver does not support https. You need to use a proper webserver like apache http or nginx to serve under https – apokryfos Nov 02 '20 at 13:13
  • [how to create the virtual host](https://ultimatefosters.com/hosting/setup-a-virtual-host-in-windows-with-xampp-server/), [how to enable https](https://stackoverflow.com/questions/5801425/enabling-ssl-with-xampp), these two link are usd to enable ssl. Is there any method except for that? – Tom Keller Nov 02 '20 at 14:52
  • 1
    Those two links work with xampp (where the 2nd letter stands for apache) not with the built-in webserver. If you set up xampp correctly and follow the directions in those links you should be able to get https working – apokryfos Nov 02 '20 at 15:08

1 Answers1

1

it's a standard protocol that HTTPS is listening on port 443, you can simply run the command to listen on that port

php artisan serve --port=443

by the way, php artisan serve is for development use only and ssl certificate is for production environment and both of them have no work relation at all as both serve their purpose differently...

although you can customize your web server to install the SSL certificate and and listening on custom port but you are breaking the standard and the public may doubt and not able to accept it...

Abanoub Hany
  • 386
  • 2
  • 7
  • I tried `php atisan serve --port 443`. [http://127.0.0.1:443/login](http://127.0.0.1:443/login) works, but [https://localhost/login](https://localhost/login) **Access forbidden!** _i You don't have permission to access the requested object. It is either read-protected or not readable by the server._ – Tom Keller Nov 02 '20 at 14:21
  • 1
    @conda Maybe this can help [link] https://stackoverflow.com/a/23594870/11567596 – Abanoub Hany Nov 02 '20 at 16:18
  • @NN73 Player // Allow invalid certificates for resources loaded from localhost. chrome://flags/#allow-insecure-localhost –  Юрий Светлов Nov 25 '21 at 20:05