cURL error 60: SSL certificate prblm: unable to get local issuer certificate [duplicate]

Solution 1:

If you are on Windows using Xampp, I am stealing a better answer from here, would be helpful if Google shows you this question first.

  1. Download and extract for cacert.pem here (a clean file format/data)

    https://curl.haxx.se/docs/caextract.html

  2. Put it in :

    C:\xampp\php\extras\ssl\cacert.pem

  3. Add this line to your php.ini

    curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"

  4. restart your webserver/Apache

Solution 2:

Seeing I am using a local environment I can safely disable SSL, which i did using the following:

$guzzleClient = new \GuzzleHttp\Client(array( 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, ), ));
$client->setHttpClient($guzzleClient);

Where $client is my Google_Client().

Solution 3:

$guzzleClient = new \GuzzleHttp\Client(['verify' => false]);

Guzzle version 6

You could refer to Guzzle Docs at

http://docs.guzzlephp.org/en/latest/request-options.html#verify

Solution 4:

I work with xamps nothing of the above did work for me

I tried this and it worked

  1. open vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php

and change this

$conf[CURLOPT_SSL_VERIFYHOST] = 2;
$conf[CURLOPT_SSL_VERIFYPEER] = true;

to this

$conf[CURLOPT_SSL_VERIFYHOST] = 0;
$conf[CURLOPT_SSL_VERIFYPEER] = FALSE;

it's a temporary solution if you updated this file the changes will lost