Laravel Socialite在本地主机上测试,SSL证书问题? [英] Laravel Socialite testing on localhost, SSL certificate issue?

查看:89
本文介绍了Laravel Socialite在本地主机上测试,SSL证书问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要在我的应用程序中插入社交登录集成,我要在我的Laravel应用程序中添加Socialite库.我注册了一个Facebook应用程序,并按照laravel文档中的2种方法进行操作: http://laravel.com/docs/5.0/authentication#social-authentication

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

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

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

请求已成功提交到Facebook并从Facebook返回,但是一旦到达回调URL:localhost:8000/social(在其中handlehanderCallback()处被调用),就会出现以下错误:

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:

RequestException.php第51行中的

RequestException: cURL错误60:SSL证书问题:无法获取本地颁发者证书

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

我曾尝试关闭防火墙,但没有成功..感到非常沮丧,有人可以帮助我吗?

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

推荐答案

我找到了解决方法

I found sollution here. I've downloaded this file

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

并在php.ini中设置路径

and set path in php.ini

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

它在服务器重新启动后起作用.

It works after server restart.

这篇关于Laravel Socialite在本地主机上测试,SSL证书问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆