Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jeimz173's avatar

cURL error 35: Unknown SSL protocol laravel 5.4 socialite facebook i need help

hi i am having trouble using socialite in laravel 5.4 my code worked at lower version but then it fails me to the latest version. but i believe this has something to do with my guzzlehttp please i need help im not sure yet

here is my code:

<?php

namespace App\Http\Controllers\auth;

use Auth;
use Socialite;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SocialAuthController extends Controller
{
  /**
    * Redirect the user to the Facebook authentication page.
    *
    * @return Response
    */
   public function redirectToProvider(){
       return Socialite::driver('facebook')->redirect();
   }

   public function handleProviderCallback()
  {
      try{
          $user = Socialite::driver('facebook')->fields([
              'first_name', 'last_name', 'email', 'gender', 'birthday'
          ])->user();

      } catch( Exception $e){
          return redirect('auth/facebook');
      }
      $authUser = $this->findOrCreateUser($user, 2);
      Auth::login($authUser, true);
      return redirect('/');
  }
}

and here is my config\app.php

<?php

return [


    'providers' => [

        Laravel\Tinker\TinkerServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,
        Laravel\Socialite\SocialiteServiceProvider::class,

    ],



    'aliases' => [

        'Socialite' => Laravel\Socialite\Facades\Socialite::class,
    ],

];

0 likes
0 replies

Please or to participate in this conversation.