Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL error 56: Proxy CONNECT aborted #478

Closed
TriNguyen1992 opened this issue Apr 13, 2018 · 11 comments
Closed

cURL error 56: Proxy CONNECT aborted #478

TriNguyen1992 opened this issue Apr 13, 2018 · 11 comments
Assignees
Labels

Comments

@TriNguyen1992
Copy link

TriNguyen1992 commented Apr 13, 2018

Hi,
I've been working with Google AdWords Api for a few days recently, and I got this error from running getCampaigns.php via command line but I haven't figured it out yet even I tried a lot. Please help me out. Anyway, I use XAMPP on Window10
many thanks,

PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 56: Proxy CONNECT aborted (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:186

@TriNguyen1992 TriNguyen1992 reopened this Apr 13, 2018
@fiboknacky fiboknacky self-assigned this Apr 13, 2018
@fiboknacky fiboknacky added the P2 label Apr 13, 2018
@fiboknacky
Copy link
Member

Hello,

It looks like you have a problem with your proxy settings.
Do you use a proxy to send requests to AdWords API?
Could you please check that the proxy allows such communication?

Best,
Knack

@TriNguyen1992
Copy link
Author

TriNguyen1992 commented Apr 14, 2018

Hi @fiboknacky , thanks so much for your quick reply.
I'll check and get back to you ASAP ^

@TriNguyen1992
Copy link
Author

TriNguyen1992 commented Apr 16, 2018

I did the settings: I turn Use setup script on, in adsapi_php.ini I configed proxy = "http://localhost:443" as I work localhost on window10 but it still didn't work for me, I just wonder what was I missing?

@fiboknacky
Copy link
Member

So your proxy is installed in localhost?
Can you use your proxy to send requests to other services / APIs?

@TriNguyen1992
Copy link
Author

So your proxy is installed in localhost?
-> I just followed exactly what's in the Adwords Api Doc says, and when I execute GetCampaigns.php (On browser or in Command Line), I got the error above, or if I tried to config proxy = "http://127.0.0.1:80" I'd get the error: cURL error 56: Received HTTP code 405 from proxy after CONNECT . Do I have other choice instead of using proxy?
I've been stucking with this problem for a few days. thanks bro ^,

@fiboknacky
Copy link
Member

Hi,

-> I just followed exactly what's in the Adwords Api Doc says, and when I execute GetCampaigns.php (On browser or in Command Line), I got the error above, or if I tried to config proxy = "http://127.0.0.1:80" I'd get the error: cURL error 56: Received HTTP code 405 from proxy after CONNECT . Do I have other choice instead of using proxy?

What doc are you talking about? Could you point me to that doc please?

In general, you have to figure out first how your proxy is configured.
I can't help on that part as I'm not able to see how your computing environment is set up.
I may help if you can try on other computers too, to see if the problem still exists.

Best,
Knack

@TriNguyen1992
Copy link
Author

TriNguyen1992 commented Apr 17, 2018

Hi @fiboknacky , thank you so much for your patience in this case to help me bro.
Actually, at the beginning the proxy config (in adsapi_php.ini) was commented and the original error was:
_Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php:98
Stack trace:
#0 C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(98): SoapClient->__doRequest('<?xml version="...', 'https://adwords...', '', 1, 0)
#1 [internal function]: Google\AdsApi\Common\AdsSoapClient->__doRequest('<?xml version="...', 'https://adwords...', '', 1, 0)
#2 C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(154): SoapClient->__soapCall('get', Array, NULL, Array, Array)
#3 C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\src\Google\AdsApi\AdWords\v201710\cm\CampaignService.php(158): Google\AdsApi\Common\AdsSoapClient->_soapCall('get', Array)
#4 C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\examples\AdWords\v201710\BasicOperations\GetCampaigns.php(55): Google\AdsApi\AdWords\v201710\cm\CampaignService->get(Object(Google\AdsApi\AdWords\v201710\cm\Selector in C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php on line 98

then I turned the proxy config on (as I read some solutions from internet) and got the error that we were talking about so far.
As the original error in this comment, do you have any idea how to fix it?

@fiboknacky
Copy link
Member

Hello,

First, if you don't have a proxy that you can use, you shouldn't turn it on.

For your problem, there are many factors that can lead to that error, such as your XAMPP isn't configured properly so you can't connect to the AdWords API servers or your SSL CA isn't installed properly.
Could you try troubleshooting using this wiki?

BTW, what version of the client library are you using?

Best,
Knack

@TriNguyen1992
Copy link
Author

TriNguyen1992 commented Apr 18, 2018

Hi @fiboknacky , thanks bro. seems we are getting close to it.
I did as the wiki you mentioned above [put the curl-ca-bundle.crt file as in C:\Windows\System32\curl-ca-bundle.crt as well as config in php.ini file: openssl.cafile="C:\Windows\System32\curl-ca-bundle.crt" ] but then I got this error:
PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 77: error setting certificate verify locations:
CAfile: C:\Windows\System32\curl-ca-bundle.crt
CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\GoogleAdwords\googleads-php-lib\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:186

Do you have any idea? I'm using v201802

@fiboknacky
Copy link
Member

Do you have any idea? I'm using v201802

No, I meant the client library version (e.g., 33.1.0), not the API.

Can you elaborate what step you tried to face with that error?
As the error message stated, you specify invalid locations for the certificate.
You have to double check if there is a certificate in that path indeed. (It seems not)

@fiboknacky
Copy link
Member

Close due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants