本地主机上的 Laravel Socialite 测试,SSL 证书问题?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28635295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 10:59:14  来源:igfitidea点击:

Laravel Socialite testing on localhost, SSL certificate issue?

laravelfacebook-social-pluginslaravel-5

提问by raphadko

To insert social login integration on my application, I'm adding Socialite library to my Laravel app. I have a facebook app registered and 2 methods as in laravel documentation: http://laravel.com/docs/5.0/authentication#social-authentication

为了在我的应用程序中插入社交登录集成,我将 Socialite 库添加到我的 Laravel 应用程序中。我注册了一个 facebook 应用程序和 2 种方法,如 laravel 文档中所示:http://laravel.com/docs/5.0/authentication#social-authentication

public function redirectToProvider()
{
    return Socialize::with('github')->redirect();
}

public function handleProviderCallback()
{
    $user = Socialize::with('github')->user();
    dd($user);
}

The request gets submitted to and returned from Facebook sucessfully, but once I reach the callback URL: localhost:8000/social (where the handleProviderCallback()) is called, I get the following error:

请求成功提交到 Facebook 并从 Facebook 返回,但是一旦我到达回调 URL:localhost:8000/social(调用 handleProviderCallback()),我收到以下错误:

RequestException in RequestException.php line 51: cURL error 60: SSL certificate problem: unable to get local issuer certificate

RequestException.php 第 51 行中的 RequestException:cURL 错误 60:SSL 证书问题:无法获取本地颁发者证书

I have tried turning off my firewall, but had no success.. getting really frustrated, can someone help me out?

我试过关闭我的防火墙,但没有成功.. 真的很沮丧,有人可以帮我吗?

回答by ?ukasz Kuczmaja

I found sollution here. I've downloaded this file

我在这里找到了解决方案。我已经下载了这个文件

http://curl.haxx.se/ca/cacert.pem

http://curl.haxx.se/ca/cacert.pem

and set path in php.ini

并在 php.ini 中设置路径

[cURL] 
curl.cainfo=C:\php\cacert.pem

It works after server restart.

它在服务器重启后工作。