sscarpa / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Certificate error? #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I made my first G+ project: create client_id, then starting to connect with 
Google Api PHP Client and Starter package.
2. Clicked "Connect Me!" Then "Allow Access"
3. I retured to my landing page, with error msg (see later). I got "code" 
params in url.

What is the expected output? What do you see instead?
Error msg was: "SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify 
failed"

What version of the product are you using? On what operating system?
I am using "google-api-php-client" and "google-plus-php-starter" on local wamp 
server.

Please provide any additional information below.
"Fatal error: Uncaught exception 'apiIOException' with message ' in 
C:\wamp\www\google-plus-php-starter\google-api-php-client\src\io\apiCurlIO.php 
on line 122" 

Br,
kP.

Original issue reported on code.google.com by mouse...@gmail.com on 15 Sep 2011 at 9:29

GoogleCodeExporter commented 8 years ago
That means your server is unable to perform peer SSL certificate verification.

Since the Windows version of PHP and it doesn't come bundled with a Certificate 
Authority bundle, you need to add it yourself.

You need to add the following line to 
google-api-php-client/src/io/apiCurlIO.php right before the line "$data = 
@curl_exec($ch);"
curl_setopt($ch, CURLOPT_CAINFO, 'c:/path/to/ca-bundle.crt');

You'll need to replace 'c:/path/to/ca-bundle.crt' to where ever you have the 
ca-bundle.crt file.

Here's a good article explaining what's going on in the windows version of PHP.
http://richardwarrender.com/2007/05/the-secret-to-curl-in-php-on-windows/

See this thread for more information:
https://groups.google.com/d/msg/google-api-php-client/S1GBH6-2KOg/92zG1mlSFIIJ

Original comment by chiragsh...@gmail.com on 15 Sep 2011 at 10:23