Thứ Bảy, 1 tháng 10, 2016

Laravel 5 Tutorial : cURL error 60: SSL certificate problem: unable to get local issuer certificate


Laravel 5.3 tutorial - Today i have a problem with SSL certificate, i create simple one application using laravel 5.3 and got some error, "RequestException in CurlFactory.php line 187:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)".

How to Fix this issue?

The correct solution is to fix your PHP setup. Please setting CURLOPT_SSL_VERIFYPEER to false is a quick hack, but it's wrong as you disable the certificate validation by it's certificate authority. This exposes you to a man-in-the-middle attack.

It's easy to fix (php 5.3.7 or higher) - Download a list file with an up-to-date certificate authorities, and add this setting to your php.ini, Download Here. After download, just save it with name "cacert.pm"
SSL certificate problem: unable to get local issuer certificate

Next, open your php.ini file.

curl.cainfo=<path-to>cacert.pem

For example, i assume your cacert file stored in C:\cacert.pem, so we will configure php.ini file with

curl.cainfo = "C:\cacert.pem"

Restart your web server, and it'll work ! i have already try using xampp and wamp server and still working.

See you next lessons..

Không có nhận xét nào:

Đăng nhận xét