Why do I get random "SSL certificate problem" error

Posted 8 months ago by agilasadi

I'm aware that the similar questions were asked but mine is differentiating and I could not find a matching answer.

The problem occurs when I'm trying to register users with social media options, or when I'm trying to do request to google for reCaptcha. In case of reCaptcha, it's acceptable since I due to a cURL request which can lead to an issue related with certification, But I could not find the reason why I get the error when I'm trying to register the user with Google or Facebook.

I tried to placing cacret.pem into PHP folder and linking it in the php.ini it was working for about 3 months and suddenly decided to not work. In this case, I'm not sure which part of the code I should share because I don't know what causes the error since I do not call Guzzle in any stage of social media registration. But since I use socialite, it might be using guzzle for doing requests.

HERE IS MY GOOGLE REGISTRATION:

try {

$googleUser = Socialite::driver('google')->user();
$existUser = User::where('email',$googleUser->email)->first();

if($existUser) {
    Auth::loginUsingId($existUser->id);
}
else {

    $user = new User;

    $user->name = $googleUser->name;
    $user->email = $googleUser->email;
    $user->password = str_random(40);
    $user->save();

    $account = new SocialMediaAccount([
        'provider_user_id' =>  $googleUser->id,
        'provider' => 'google'
    ]);

    $account->user()->associate($user);
    $account->save();

    Auth::loginUsingId($user->id);
}

return redirect()->to('/home');
}
catch (Exception $e) {
        return 'error';
}

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

Please sign in or create an account to participate in this conversation.