I am facing this error while setting up Google+ OAuth when it redirects to the callback page and I don't know how to resolve it I am using google api php client v2.2.0
Fatal error: Uncaught GuzzleHttp\Exception\RequestException: 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) in C:\xampp\htdocs\phpoauth\GoogleApi\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 C:\xampp\htdocs\phpoauth\GoogleApi\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp\htdocs\phpoauth\GoogleApi\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp\htdocs\phpoauth\GoogleApi\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handle in C:\xampp\htdocs\phpoauth\GoogleApi\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187
this is what I have tried in php config.php
<?php
session_start();
require_once "GoogleApi/vendor/autoload.php";
$gclient = new Google_Client();
$gclient->setClientId("myClientID");
$gclient->setClientSecret("myClientSecret");
$gclient->setApplicationName("NC Login Tutorial");
$gclient->setRedirectUri("http://localhost/phpoauth/g-callback.php");
$gclient->addScope("https://www.googleapis.com/auth/userinfo.email");
?>
g-callback.php
<?php
require_once "config.php";
if(isset($_GET['code'])){
$token = $gclient->fetchAccessTokenWithAuthCode($_GET['code']);
$_SESSION['access_token'] = $token;
}
$oAuth = new Google_Service_Oauth2($gclient);
$userData = $oAuth->userinfo_v2_me->get();
echo "<pre>";
var_dump($userData);
?>
besides this problem is there an easy way to set up an OAuth on your website which is secure as well?