Use SSL on Laravel Homestead

余生长醉 提交于 2019-11-30 05:19:38

I assume you are using Windows + Vagrant machine with Homestead.
In this case laravel-cashier.local is your web application.

You need to copy the certificate inside Vagrant, in Nginx to external folder:

$ sudo cp /etc/nginx/ssl/laravel-cashier.local.crt ~/laravel-cashier/laravel-cashier.local.crt

In Windows environment you can install this certificate with double-click and select the next specific storage:

Trusted Root Certification Authorities

Restart your browser. Done.

More info about how to add certificate: https://technet.microsoft.com/en-us/library/cc754841(v=ws.11).aspx#BKMK_addlocal

NOTE: This is valid for specific browser: Google Chrome

It is as I first suspected and mentioned in my comment. You SSL config seems correct since it reports the connection is secure. You are using a self signed certificate, which is fine for development, but it not signed by a recognized Certificate Authority and therefore the browser will not trust it. However once you deploy your project to the general public you will want to purchase a certificate from a recognized Certificate Authority. Once you have that certificate then this error will go away.

This is only a year old question but it feels like it is really old one.

Fist - with a version 6.1.0 of 'laravel/homestead" vagrant box you don't need any ssl: true, it is active by default, however your browser would not know if it can trust the ssl certificate anyway.

The browser trust is a different issue to laravel and homestead, please see this answer to solve it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!