Ulicni Hodac
7 years ago

cURL error 60: SSL certificate problem when using Guzzle


By using Guzzle in Laravel to get some API data from twitter or facebook, you can get this message:

cURL error 60: SSL certificate problem

and if in your composer file you have guzzle version 6.*.*  like this:

"guzzlehttp/guzzle": "~6.1.1",
"guzzlehttp/oauth-subscriber": "dev-master",

then you probably calling guzzle by using this command:

$client = new GuzzleHttp\Client([
                'handler' => $stack
            ]);

which is quit OK except it can not get data from SSL domains, so only thing that you need to do is disable cert verification by adding line verify=false inside array parameters:

$client = new GuzzleHttp\Client([
                'handler' => $stack,
                'verify' => false
            ]);

and problem solved