Laravel 5 Socialite - cURL error 77: error setting certificate verify locations

I got stuck on this problem as well. It turned out that I had the path to my certificate set incorrectly in my php.ini file. Forgot the .txt extension.

What I had:

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

What I changed it to:

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

Hope this helps.


Add cacert.pem file from https://curl.haxx.se/ca/cacert.pem in c:\xampp\php\cacert.pem

Change setting in php.ini file:

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


My error is:

cURL error 77: error setting certificate verify locations: CAfile: C:\xampp\apache\bin\curl-ca-bundle.crt CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)


This works well for me:

  1. Download the certificate from: https://curl.haxx.se/ca/cacert.pem
  2. Rename the cacert.pem file into curl-ca-bundle.crt
  3. Copy the file into path/to/xampp/apache/bin
  4. Restart apache

  1. Save this certificate (https://curl.haxx.se/ca/cacert.pem) as cacert.pem.txt in C:\xampp\php
  2. Add to php.ini:

    curl.cainfo = "C:\xampp\php\cacert.pem.txt"
    
  3. Don't forget to restart XAMPP (it won't work until it restarts)

Then it works fine!