Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

eddy1992's avatar

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

I am using 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)

My controller :

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Socialite;

class AccountController extends Controller
{
    public function facebook_redirect() 

    {
        return Socialite::with('facebook')->redirect();
    }

    public function facebook()
    {
         $user = Socialite::with('facebook')->user();
    }
}

please help Thank you :)

0 likes
17 replies
eddy1992's avatar

Does anybody know what could be the problem ? Please help :(

khaledSMQ's avatar

i solve it by remove the guzzlehttp/guzzle version 6 and install guzzlehttp/guzzle version 4

eddy1992's avatar

@bashy I use the option Obtain DNS server address automatically and yes I use local router.

bashy's avatar

Yeah you could try using a public DNS for developing. Which is why I use a VM so I can set this up separately!

If I use local DNS, it fails. If I use Google's, it works.

lalitesh's avatar

If someone is still looking for a solution, there is an easy fix:

Go to http://curl.haxx.se/ca/cacert.pem and download the pem file and save in your php installation directory ( make sure while saving it retains the extension and not saved as a text file )

Now, open your php.ini file, scroll to the bottom and add the following line:

[cURL] 
curl.cainfo="D:\xampp\php\cacert.pem"

Replace D:\xampp\php\cacert.pem with the actual path.

Courtesy: http://stackoverflow.com/questions/17478283/paypal-access-ssl-certificate-unable-to-get-local-issuer-certificate

12 likes
sorcjc's avatar

I have download the caert.pem file and save it in C:\wamp\bin\php\php5.5.12, with the proper extension. Next I modified and uncomment the next line:

curl.cainfo = "c:/wamp/bin/php/php5.5.12/cacert.pem"

But it still doesn't work.

EDIT: We have to modify C:\wamp\bin\apache\apache2.4.9\bin\ if we use wampserver (instead of C:\wamp\bin\php\php5.5.12\).

3 likes
wmhilton's avatar

(Using XAMPP version 7.0.9 on Windows 10.) After 50 minutes of searching and trying things, it was a single line fix:

Edit C:\xampp\php\php.ini and add the line:

curl.cainfo = "C:/xampp/apache/bin/curl-ca-bundle.crt"

Oddly I didn't even have to update curl-ca-bundle.crt to a new version. Just needed that setting set.

Edit: AND restart Apache! :smiley:

3 likes
HebaShop's avatar

I have just signed for this forum just to commend @wmhilton . I have searched for the solution for this problem for days and yours was the best. Thank you boss! Saved me hours

1 like
georgeos's avatar

In case someone is using Wamp server, the right file is located in: "C:\wamp\bin\apache\apache\bin\php.ini"

razikallayi's avatar

I tried it without a php artisan serve. Loaded the file directly from my wamp/www folder and it works fine

mvww11's avatar

I got the same problema using PHP 5.6~. When I changed to PHP 7~, it solved the problem.

Please or to participate in this conversation.