如何解决cURL错误60:SSL认证在Laravel 5同时Facebook身份验证 [英] How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication
问题描述
目前,我在laravel5上执行一个项目。
我使用socialize进行Facebook身份验证,但是我遇到了cURL错误。
CurlFactory.php中的RequestException第162行:
cURL错误60:SSL证书问题:无法获取本地颁发者证书.haxx.se / libcurl / c / libcurl-errors.html)
我的控制器代码
public function fb()
{
return Socialize :: with('facebook') - > redirect();
}
public function cb()// callback for facebook
{
$ user = Socialize :: with('facebook') - > user();
var_dump($ user);
}
我只花了几个小时的时间有了这个。正确的答案是
确实把cacert.pem文件和修改php.ini文件匹配上面的Moez建议。 。但是我一直在得到CURL错误60的诀窍是得到一个干净的副本的PEM文件!任何方法涉及Windows记事本或其他编辑器损坏的文件,并给出cURL错误60等。最后,我发现https://gist.github.com/VersatilityWerks/5719158/download ,并下载了一份含有cacert.pem文件的完整副本的tar文件。
因为你是在Windows上工作,这可能是问题。
Currently, I am doing a project on laravel5.
I use socialize for Facebook authentication,But I got cURL error Mentioned below.
RequestException in CurlFactory.php line 162:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I have searched on internet and done following changes but didn't helped
- downloaded cart.pem file
- set path "curl.cainfo ="C:\xampp\cacert.pem"
- also uncomment "extension=php_curl.dll"
My code of in controller
public function fb()
{
return Socialize::with('facebook')->redirect();
}
public function cb() //callback for facebook
{
$user = Socialize::with('facebook')->user();
var_dump($user);
}
I just spent a number of hours grappling with this. The correct answer is
"indeed to put the cacert.pem file and amend the php.ini file to match as suggested by Moez above. ..... but I kept on getting CURL error 60's The trick was getting a clean copy of the PEM file! Any method involving windows notepad or other editors corrupts the file and gives the cURL error 60 etc. Finally I found https://gist.github.com/VersatilityWerks/5719158/download and downloaded a tar file with a clean copy of the cacert.pem file ...... it then all worked perfectly."
And since you are working on Windows, this could be the problem.
这篇关于如何解决cURL错误60:SSL认证在Laravel 5同时Facebook身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!