NicklasWallgren / PokemonGoAPI-PHP

Pokemon Go API PHP library
BSD 2-Clause "Simplified" License
130 stars 51 forks source link

Guzzle herror after update #151

Closed paoloalby closed 7 years ago

paoloalby commented 7 years ago

After the recent update, I get this error every time I try to use this API:

Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\wamp64\www\pogoinformer\PokemonGoAPI-PHP\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

With the preovious version (I made a backup), I can login without any error.

DrDelay commented 7 years ago

Download https://curl.haxx.se/ca/cacert.pem and try setting curl.cainfo to the path to it in php.ini:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = /path/to/cacert.pem
NicklasWallgren commented 7 years ago

The problem is not related to this library.

Either disable the certification check or fix your environment.

Quick and dirty fix.

$client = new \GuzzleHttp\Client();
$client->setDefaultOption('verify', false);

$application = new ApplicationKernel($manager);
$application->setClient(client);
paoloalby commented 7 years ago

Ok, everything ok now. Thanks!