What are requirements for poxy server to coop with Google AdWordsAPI library

314 views
Skip to first unread message

Sebastian Piskorski

unread,
Oct 18, 2017, 9:02:36 AM10/18/17
to AdWords API Forum
I'm dealing with very restrictive proxy server, where I have to use credentials and all traffic is blocked by default. Administrator can unlock certain domains for me but I have to list them for him. So far he had unlocked for me following domains:

but still, when I try to connect with examples I get error:

PHP Fatal error:  Uncaught exception 'GuzzleHttp\Exception\ConnectException' with message 'cURL error 7: Failed to connect to 2a00:1450:4016:80c::200a: Network is unreachable (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
Stack trace:
#0 /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 /vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Han in /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186


My configuration for proxy is set in "adsapi_php.ini" file in home folder. All other options like "refreshToken" or "developerToken" are also set.

Is there a way to force library to use "*.1e100.net" instead of IPv6 "2a00:1450:4016:80c::200a:" addresses.

Jude Amagoh

unread,
Oct 18, 2017, 4:30:33 PM10/18/17
to adwor...@googlegroups.com
Hi,

I'd be glad to assist you with your query but, unfortunately this question is out of my scope. I recommend you post your question on the php github and they'll be better equipped to answer this question

Best Regards,
Jude, Adwords API Team

Sebastian Piskorski

unread,
Oct 19, 2017, 3:39:25 AM10/19/17
to AdWords API Forum
But requirements for proxy should be the same for all languages. All I need is probably list of addresses that I have to whitelist in order to run AdWords API requests through proxies using Google Library. Also, I think you should know CURL and why lib tries to connect "2a00:1450:4016:80c::200a:", and how to force it to use domain address instead.

Dorian Kind

unread,
Oct 19, 2017, 9:07:06 AM10/19/17
to AdWords API Forum
If I may chime in, I'm pretty sure the googleads library only connects to "adwords.google.com". The "1e100.net" domain probably originates from a reverse lookup:

$ host adwords.google.com 
adwords.google.com is an alias for adwords.l.google.com.
adwords.l.google.com has IPv6 address 2a00:1450:400c:c04::64

$ host 2a00:1450:400c:c04::64 
4.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.0.c.0.c.0.0.4.0.5.4.1.0.0.a.2.ip6.arpa domain name pointer wk-in-x64.1e100.net.


So if we're talking about a web proxy, whitelisting the "adwords.google.com" host should be fine. If you really need to whitelist on the network level, Google announces quite a number of IPv6 prefixes...

Sebastian Piskorski

unread,
Oct 20, 2017, 4:59:59 AM10/20/17
to AdWords API Forum
@Dorian Kind, Thank you for the reply.

Your answer gives some light to my issue, but I don't quite understand what " originates from a reverse lookup:" means. I have whitelisted "adwords.google.com" but an error is still the same. At least when I try to run examples, provided by the lib.

Dorian Kind

unread,
Oct 20, 2017, 8:15:25 AM10/20/17
to AdWords API Forum
I think you need to take a look at this issue with your administrator, as it's hard to say what's going on without knowing how your proxy setup looks like.

To the best of my knowledge, as far as the Adwords API client library is concerned, all you need is to be able to make HTTPS requests to the "adwords.google.com" host. Except probably for the BatchJobService, which AFAIK uses Google Cloud Storage to up/download large jobs.

Sebastian Piskorski

unread,
Nov 24, 2017, 12:11:37 PM11/24/17
to AdWords API Forum
@Dorian Kind

I'm still fighting with that proxy config and I would like to ask for your opinion. I have disabled IPv6 on a server and now I got a different error, without IPv6 address cURL error 7: Failed connect to www.googleapis.com:443; Operation now in progress.. Infrastructure owner says I don't use proxy properly, but the only option I have is to configure lib. I did run an example GetCampaigns with and without proxy configured and I have different curl errors. I made sure that proper config file is used. Lib example was run outside any application.


Is it possible that GoogleAds lib somehow ignores proxy config? 


Running requests with curl from Linux console pass proxy just fine.


Here is the output with and then without proxy configured:


[us...@server.com examples]$ php -f AdWords/v201705/BasicOperations/GetCampaigns.php --no-chdir
PHP Fatal error:  Uncaught exception 'GuzzleHttp\Exception\ConnectException' with message 'cURL error 7: Failed connect to www.googleapis.com:443; Operation now in progress (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in /home/user/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
Stack trace:
#0 /home/user/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /home/user/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 /home/user/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 /home/wg in /home/user/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186

[us...@server.com examples]$ vi ~/adsapi_php.ini //disabling proxy config

[us...@server.com examples]$ php -f AdWords/v201705/BasicOperations/GetCampaigns.php --no-chdir
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl' : failed to load external entity "https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl"
 in /home/user/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php on line 65
PHP Fatal error:  Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl' : failed to load external entity "https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl"
 in /home/user/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php:65
Stack trace:
#0 /home/user/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(65): SoapClient->SoapClient('https://adwords...', Array)
#1 /home/user/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/v201705/cm/CampaignService.php(145): Google\AdsApi\Common\AdsSoapClient->__construct('https://adwords...', Array)
#2 [internal function]: Google\AdsApi\AdWords\v201705\cm\CampaignService->__construct(Array)
#3 /home/user/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(39): ReflectionClass->newInstanceArgs(Array)
 in /home/user/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php on line 65
Reply all
Reply to author
Forward
0 new messages