googleads / google-ads-python

Google Ads API Client Library for Python
Apache License 2.0
521 stars 480 forks source link

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain #822

Closed sushantsur23 closed 10 months ago

sushantsur23 commented 11 months ago

Code and Error screenshot.docx I have attached the updated code in order to push the data to google ads account. however I am getting the below error message. Kindly help me to resolve this issue.

Traceback (most recent call last): File "D:\Projects\google_ads_integration\campaign.py", line 57, in googleads_client = GoogleAdsClient.load_from_storage(path="google-ads.yaml",version="v14") File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\ads\googleads\client.py", line 291, in load_from_storage kwargs = cls._get_client_kwargs(config_data) File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\ads\googleads\client.py", line 182, in _get_client_kwargs "credentials": oauth2.get_credentials(config_data), File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\ads\googleads\oauth2.py", line 114, in get_credentials return get_installed_app_credentials( File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\ads\googleads\oauth2.py", line 48, in initialize_credentials_wrapper credentials.refresh(Request()) File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\oauth2\credentials.py", line 344, in refresh ) = reauth.refresh_grant( File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\oauth2\reauth.py", line 332, in refresh_grant response_status_ok, response_data, retryable_error = _client._token_endpoint_request_no_throw( File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\oauth2_client.py", line 215, in _token_endpoint_request_no_throw request_succeeded, response_data, retryable_error = _perform_request() File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\oauth2_client.py", line 191, in _perform_request response = request( File "D:\Projects\google_ads_integration\ads\lib\site-packages\google\auth\transport\requests.py", line 192, in call raise new_exc from caught_exc google.auth.exceptions.TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1007)'))) (D:\Projects\google_ads_integrationds)

BenRKarl commented 10 months ago

@sushantsur23 It looks like your OAuth may not be set up correctly. I would file an issue in the google-auth-library-python-oauthlib repository. Also this past issue seems like it might be relevant as well.