Laravel 5.2 Socialite Facebook登录cURL错误60 [英] Laravel 5.2 Socialite Facebook Login cURL error 60
问题描述
我在CurlFactory.php行187中收到错误 RequestException:
cURL错误60:SSL证书问题:无法获取本地颁发者证书(请参阅curl.haxx.se/libcurl/c/ libcurl-errors.html)尝试使用社交界面登录。这是我遵循的教程。 http:/ /blog.damirmiladinov.com/laravel/laravel-5.2-socialite-facebook-login.html#.V2K-ersrLIV 。
I'm getting an error RequestException in CurlFactory.php line 187: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see curl.haxx.se/libcurl/c/libcurl-errors.html) when trying to login with socialite facebook. This is the tutorial I followed http://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-facebook-login.html#.V2K-ersrLIV .
这是我的控制器:
public function redirect()
{
return Socialite::driver('facebook')->redirect();
}
public function callback()
{
// when facebook call us a with token
$providerUser = \Socialite::driver('facebook')->user();
}
从我的研究中我发现错误是由于guzzlehttp的版本/guzzle.I尝试了这些链接中提供的解决方案,但它并不适用于我。 本地主机上的Laravel Socialite测试,SSL证书问题?和< a href =https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954 = nofollow noreferrer> https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954 一>。请帮助。
From my research I found out the error is as a result ofthe version of guzzlehttp/guzzle.I tried the solutions provided in these links but it didn't work for me. Laravel Socialite testing on localhost, SSL certificate issue? and https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954. Kindly help.
推荐答案
对于那些仍然需要解决方案,这里是。
For those that still need a solution, here it is.
$providerUser = \Socialite::driver('facebook')
->setHttpClient(new \GuzzleHttp\Client(['verify' => false]))
->user();
请注意 ['verify'=> false]
,这将禁用由Socialite使用的Guzzle HTTP客户端完成的SSL证书验证检查。将其导出到配置中也可能是一个好主意。
Note the ['verify' => false]
, this disables the SSL certificate verification check done by the Guzzle HTTP client which is used by Socialite. It might also be a good idea to export this into the configuration as a setting.
这篇关于Laravel 5.2 Socialite Facebook登录cURL错误60的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!