-
Notifications
You must be signed in to change notification settings - Fork 974
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
ProxyError: 407: Authentification required #540
Comments
Hello, I strongly suspect the core issue here is that you're defining the proxy outside of the library. As currently implemented, we use ProxyConfig to pass the proxy details along to Zeep. This can be configured in googleads.yaml, or passed along as an argument for AdManagerClient if you prefer to set it up manually. Regards, |
Hi Mark, thanks for the quick reply. I doubt that this is the case (maybe my hint about requests was misleading, because I do not use this in the current Google Ads project). I do specify the proxy in the googleads.yaml like so: proxy_config:
'http': 'http://[DOMAIN]%5C[USER]:[PWD]@[HOST]:8080' This config is then used from googleads import ad_manager
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage("googleads.yaml")
activity_service = ad_manager_client.GetService('ActivityService', version='v202402') When I try to get the ActivityService for example, I get the 407. |
Hello, Thanks for clarifying, I had in fact misinterpreted that original post, sorry about that! So, I'll be upfront about it–it would be quite difficult for me to troubleshoot your specific proxy issue, but I can say that the fact you received an HTTP 407 response strongly suggests that the library passed along your proxy configuration to Zeep, which then made the request, and did at least communicate with your proxy so that it could return the authentication error. I'd like to at least provide some explanation on why this doesn't appear to be an issue with this library though, so read on if that interests you. Looking at the underlying implementation, For some additional context, the transport created above is a _ZeepProxyTransport, which applies the proxies to the Session used by the Zeep
Once again, I can confirm that the proxy configuration is applied to the session used to make the call, so it appears to be working as intended. |
Hi Marc, |
Great, happy to hear you were able to figure it out! |
Hi guys,
I am sitting behind a company firewall and have to use our proxy for any requests.
In other projects we relied on the requests package. Everything works fine here:
However, having specified the exact same URL for the proxy in the googleads.yaml I get the following error for any request:
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ads.google.com', port=443): Max retries exceeded with url: /apis/ads/publisher/v202402/ActivityService?wsdl (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 407 authenticationrequired')))
For example:
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage("googleads.yaml")
activity_service = ad_manager_client.GetService('ActivityService', version='v202402')
Any suggestions?
Thanks in advance.
The text was updated successfully, but these errors were encountered: