You can solve your problem by editing file: src/Google/Api/Ads/Common/
Utils/CurlUtils.php

Add to the method CreateSession 2 strings:

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

It will look like this:

 public static function CreateSession($url) {
    $ch = curl_init($url);

    // Default options.
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // Proxy options.
    if (defined('HTTP_PROXY_HOST') && HTTP_PROXY_HOST != '') {
      curl_setopt($ch, CURLOPT_PROXY, HTTP_PROXY_HOST);
    }
    if (defined('HTTP_PROXY_PORT') && HTTP_PROXY_PORT != '') {
      curl_setopt($ch, CURLOPT_PROXYPORT, HTTP_PROXY_PORT);
    }
    if (defined('HTTP_PROXY_USER') && defined('HTTP_PROXY_PASSWORD')
        && HTTP_PROXY_USER != '' && HTTP_PROXY_PASSWORD != '') {
      curl_setopt($ch, CURLOPT_PROXYUSERPWD, HTTP_PROXY_USER . ':'
          . HTTP_PROXY_PASSWORD);
    }

    // SSL options.
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    if (defined('SSL_VERIFY_PEER') && SSL_VERIFY_PEER != '') {
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, SSL_VERIFY_PEER);
    }
    if (defined('SSL_CA_PATH') && SSL_CA_PATH != '') {
      curl_setopt($ch, CURLOPT_CAPATH, SSL_CA_PATH);
    }
    if (defined('SSL_CA_FILE') && SSL_CA_FILE != '') {
      curl_setopt($ch, CURLOPT_CAINFO, SSL_CA_FILE);
    }

    return $ch;
  }

On 2 апр, 01:51, kush <kushva...@outofboundscommunications.com> wrote:
> hi,
> i tried to download reports using cURL.
> my code looks something like this
> ............
> $authToken =
>     new AuthToken($email, $password, 'adwords', 'PHP Sample Code',
> 'GOOGLE');
>
> // Create download URL.
> $url = sprintf('https://adwords.google.com/api/adwords/reportdownload?
> __rd=%d',
>     $reportDefinitionId);
>
> // Create headers.
> $headers = array();
> $headers[]= 'Authorization: GoogleLogin auth='. $authToken->GetAuthToken();
>
> $headers[]= 'clientEmail: ' . $clientEmail;
> .................
> $ch = curl_init($url);
> curl_setopt($ch, CURLOPT_FILE, $file);
> curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_HEADER, 0);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
> curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
> curl_exec($ch);
> ....
> I've set the email and password. But the problem is i get an exception
> that looks like this:
>
> 'AuthTokenException' with message 'Failed to get authToken. Reason:
> SSL certificate problem, verify that the CA cert is OK. Details: error:
> 14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:
>
> please help me how to resolve it?

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to