Hi!!

I've sucessfully executed sample examples provided in PHP API.

In my localhost Windows environment I just overrided SSL validation setting 
it to false (I know it's not recommeded). I also had to manually specify 
clientCustomerId because the value specified in the .ini file was not taken 
into account.

      $soapSettings = (new SoapSettingsBuilder())
      ->disableSslVerify()
      ->build();

      $session = (new AdWordsSessionBuilder())
      ->fromFile()
      ->withSoapSettings($soapSettings)
      ->withOAuth2Credential($oAuth2Credential)
      ->withClientCustomerId("123-456-7890")
      ->build();


Sample GetCampaings.php  or GetReportFields worked like a charm.

The problem arises when executing sample 
DownloadCriteriaReportWithSelector. Again there are problems with SSL 
validation.

Looks like the http calls made with Guzzle does not take into account  the 
disableSslVerify() in SoapSettings. When executing I get this error.

PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Error 
creating resource: [message] fopen(): SSL operation failed with code 1. 
OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify 
failed
[file] 
E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php
[line] 329
[message] fopen(): Failed to enable crypto
[file] 
E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php
[line] 329
[message] 
fopen(https://adwords.google.com/api/adwords/reportdownload/v201710): 
failed to open stream: operation failed
[file] 
E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php
[line] 329' in 
E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php:252
Stack trace:
#0 
E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php(341):
 
GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure))
#1 E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\sr in 
E:\xampp\htdocs\apiadwords\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
 
on line 52

I just "solved it" (not a solution I know) by hacking Guzzle's 
StreamHandler and forcing enable SSL validation to false.

        // Ensure SSL is verified by default
        if (!isset($options['verify'])) {
            $options['verify'] = false;
        }
        
        // Horrible hack to not to do
        $options['verify'] = false;

How could I solve this in a more appropiate way?
Thanks a lot !!!!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b6b95f75-d473-4c82-abe6-399af6503d45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • SSL problem only... Joaquín

Reply via email to