Google Php Oauth Login Error No system CA bundle c

2019-02-25 15:20发布

I am exactly following the example but get an error on $client->authenticate($_GET['Code']); The code value is being returned but will not authenticate. The error is

Fatal error: Uncaught exception 'RuntimeException' with message ' No system CA bundle could be found in any of the the common system locations. PHP versions earlier than 5.6 are not properly configured to use the system's CA bundle by default. In order to verify peer certificates, you will need to supply the path on disk to a certificate bundle to the 'verify' request option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not need a specific certificate bundle, then Mozilla provides a commonly used CA bundle which can be downloaded here (provided by the maintainer of cURL): https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP ini setting to point to the path to the file, allowing you to omit the 'verify' request option. See http://curl.haxx.se/docs/sslcerts.html for more information.' in /base/data/home/apps/s~solomon-1/1.388711045841969234/google-api-php-client/vendor/guzzlehttp/ringphp/src/Client/Cli in /base/data/home/apps/s~solomon-1/1.388711045841969234/google-api-php-client/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 51

??

2条回答
Evening l夕情丶
2楼-- · 2019-02-25 15:44

App Engine Php requires curl to be expressly enabled in the php.ini file at the root directory with the ini line extension = "curl.so" Be careful with the releases, Confusing sets of oauth proceedures, and I found an update and it was only mentioned in the Readme of the download I thought was current.

查看更多
趁早两清
3楼-- · 2019-02-25 15:58

Looking through Google and Guzzle's code you might need to specify where the certificate bundle can be found by doing something like the following when you setup the Google Client and before your authenticate() call:

$client->setHttpClient(new GuzzleHttp\Client(['verify'=>'path\to\your\cert-bundle']));

This will override the default behavior and let you specify where the bundle is.

You could also test that this is the right direction by setting verify to false:

$client->setHttpClient(new GuzzleHttp\Client(['verify'=>false]));

This will basically tell curl not to verify the host nor the peer.

查看更多
登录 后发表回答