Laravel 5.2 Socialite Facebook登录cURL错误60 [英] Laravel 5.2 Socialite Facebook Login cURL error 60
问题描述
我收到一个错误 RequestException在CurlFactory.php第187行:
cURL错误60:SSL证书问题:无法获取本地颁发者证书(参见curl.haxx.se/libcurl/c/ libcurl-errors.html)时尝试使用社交Facebook登录。这是我遵循的教程 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 .
这是我的控制器: / p>
This is my controller:
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对localhost的社交性测试,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> https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954 。请帮助。
推荐答案
对于那些仍然需要解决方案的人,这里是。
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屋!