0

I am trying to make a social authenication system via socialite in my Laravel app.But I am getting this error:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I have downloaded several cacert.pem file,i have found on the internet (Basically,on stackoverflow from same problem).I add them to my

 C:\wamp\bin\apache\apache2.4.9\bin\php.ini
  C:\wamp\bin\php\php5.5.12\php.ini

file like this

    curl.cainfo = "C:/somewhere/cacert.pem"` 

    curl.cainfo = "C:\somewhere\cacert.pem"

   curl.cainfo = "c:/somewhere/cacert.pem"

   curl.cainfo = "c:\somewhere\cacert.pem"

I have also clicked the green WAMP icon and go to PHP->php.ini and tried the similar code.But all in vain.I am getting the error again and again.

Asm Arman
  • 359
  • 6
  • 24
  • Did you try to send your certificate with your cURL request? See [here](http://stackoverflow.com/questions/33880306/how-to-send-a-curl-request-with-pem-certificate-via-php/33939257#33939257) – James Sep 25 '16 at 12:13
  • Agree with above, the most important part is to show is the line of code that is failing! Please eidt your Q to show your current best attempt at the call to `curl`. Good luck. – shellter Sep 25 '16 at 14:35

2 Answers2

1

TRY bypass

Edit For SSL EROR
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

search private function applyHandlerOptions(EasyHandle $easy, array &$conf)
----------------------------------------------------------
if ($options['verify'] === false) {
                unset($conf[CURLOPT_CAINFO]);
                $conf[CURLOPT_SSL_VERIFYHOST] = 0;
                $conf[CURLOPT_SSL_VERIFYPEER] = false;
            } else {
                $conf[CURLOPT_SSL_VERIFYHOST] = 2;
                $conf[CURLOPT_SSL_VERIFYPEER] = true;
----------------------------------------------------------
Change
----------------------------------------------------------
if ($options['verify'] === false) {
                unset($conf[CURLOPT_CAINFO]);
                $conf[CURLOPT_SSL_VERIFYHOST] = 0;
                $conf[CURLOPT_SSL_VERIFYPEER] = false;
            } else {
                $conf[CURLOPT_SSL_VERIFYHOST] = false;
                $conf[CURLOPT_SSL_VERIFYPEER] = false;
-----------------------------------------------------------
tolgatasci
  • 152
  • 1
  • 11
0

i) Download the 'cacert.pem' file from this link

ii) Extract it & copy to the location you want.

iii) Add this setting to your php.ini

curl.cainfo=<path-to>cacert.pem

In my case the location was, C:\wamp\bin\php\php5.6.24\extras\ssl. So the php.ini setting..

curl.cainfo ="C:\wamp\bin\php\php5.6.24\extras\ssl\cacert.pem"

Restart your web server, and it'll work !

mahmed
  • 1
  • 1