如何解决cURL错误60:SSL认证在Laravel 5同时Facebook身份验证 [英] How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

查看:1696
本文介绍了如何解决cURL错误60:SSL认证在Laravel 5同时Facebook身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我在laravel5上执行一个项目。



我使用socialize进行Facebook身份验证,但是我遇到了cURL错误。

  CurlFactory.php中的RequestException第162行:
cURL错误60:SSL证书问题:无法获取本地颁发者证书.haxx.se / libcurl / c / libcurl-errors.html)


  • 设置路径curl .cainfo =C:\ xampp\cacert.pem

  • 也取消注释extension = php_curl.dll



  • 我的控制器代码

      public function fb()
    {
    return Socialize :: with('facebook') - > redirect();
    }
    public function cb()// callback for facebook
    {
    $ user = Socialize :: with('facebook') - > user();
    var_dump($ user);
    }


    解决方案

    https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local -issuer-certificate



    https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem -unable-to-get-local-issuer-certificate / replies / 52954


    我只花了几个小时的时间有了这个。正确的答案是



    确实把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);
    }
    

    解决方案

    https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate

    https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954

    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屋!

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