2

I am using Laravel Socialite in my app. I am using Login with Google! However, I am getting this cURL error 60: SSL certificate problem: unable to get local issuer certificate error.

I went through this: cURL error 60: SSL certificate: unable to get local issuer certificate and did the exact steps but still, it won't work.

I tried this in php.ini:

curl.cainfo="C:\wamp64\bin\php\php7.2.4\extras\ssl\cacert.pem"

Here's my api.php:

Route::group(['middleware' => 'web'], function() {
    Route::get('login/google', function() {
        return Socialite::driver('google')->redirect();
    });
    Route::get('login/google/callback', function() {
        $user = Socialite::driver('google')->stateless()->user();
        return $user->token();
    });
});

I am using php artisan serve to serve my application. Please help!

Axel
  • 4,365
  • 11
  • 63
  • 122
  • Laravel not uses wamp server... try this issue https://stackoverflow.com/questions/42094842/curl-error-60-ssl-certificate-in-laravel-5-4 – Etibar Jul 18 '18 at 07:29
  • @EtibarRustemzade Don't say that you are suggesting me to touch the vendor files! – Axel Jul 18 '18 at 07:30
  • Which php.ini did you change? If your using `php artisan serve`, you might want to check where your binary is, https://github.com/symfony/process/blob/master/PhpExecutableFinder.php#L36 if you changed the wrong ini file it wont work. – Lawrence Cherone Jul 18 '18 at 07:48
  • @LawrenceCherone I just did: `Click Wampserver icon>PHP>php.ini` – Axel Jul 18 '18 at 07:52
  • @Sanjay I think you missunderstood, look at the code in the link, `C:\wamp64\bin\php\php7.2.4\php.exe` might not be used by `php artisan serve`, but instead it fallsback to php cli server, if so changing your "php.ini" file might not make a difference as it's not the one used.. Can you run `phpinfo()` in your php code? – Lawrence Cherone Jul 18 '18 at 07:55
  • Yes, I am able to run `phpinfo()` and it says the version is `PHP Version 7.2.4`! Also there is `Loaded Configuration File: C:\wamp64\bin\php\php7.2.4\php.ini`! – Axel Jul 18 '18 at 07:58
  • Oh yes! The changes are not saved there. Trying it from there now! – Axel Jul 18 '18 at 07:59
  • @LawrenceCherone That worked! Thank you so much. You are life savior! – Axel Jul 18 '18 at 08:00
  • np, glad it helped – Lawrence Cherone Jul 18 '18 at 08:01
  • @LawrenceCherone I guess you should write the answer for it! You know the first glance goes to the Answers section rather than the comments section. – Axel Jul 18 '18 at 08:02

0 Answers0