-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate ve rify failed (_ssl.c:661)> #478
Comments
Hi I'm trying to generate report using Adword API. It was working fine on my local laptop (Windows 10). But when I deploy to the remote server (Windows Server 2012 R2), I'm getting below error message: urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)> Checked my python and lib versions, don't think it's the version issue. Anyone can suggest what are the potential reason? |
Can you connect to |
No, the server couldn't connect to the web. Are there any alternatives? Is it required for the API to work? |
I could Ping google.com from the cmd |
ping is not the same as being able to establish a secure connection. The server needs to be able to access https://googleapis.com. |
I'm getting reports of some users getting this error for one of my projects. Upon further investigation, it looks like the certificate of the server was probably very recently changed (within three weeks) and, very oddly (though not very relevantly), it looks to expire after just three months (May). It doesn't seem likely, but, if there was some way, some place that this could be cached, then this might explain the verification problem. This type of issue would've just started being observed three weeks ago. |
I'm getting the same error but on my local machine, not on a server. I've set Is there anything I can do to help diagnose the issue? @jonparrott, you asked about being able to connect to google.com and googleapis.com using other programs (excluding web servers), so I tried using openssl to connect (following these instructions). Here are the (truncated) responses, first for googleapis.com:
...and for google.com:
I don't know anything about diagnosing this kind of problem, I'm afraid, so any guidance would be welcome. I'm running Windows 10 Pro and have updated httplib2, google-api-python-client, and oauthlib to the latest versions since getting the error (which made no difference). The code was working fine last week and I've made no changes to it since then. |
Far and above the most common culprits here are outdated versions of OpenSSL and outdated CA certificates. I would highly recommend trying with Python 3.6.2 from the official installer on windows (which will include a recent version of SSL). Barring that, you can try installing |
You can also try installing |
Just a comment that might help folks with this issue - I had this issue today on Ubuntu 16.04 and macOS, and the actual solution for me was that I had A quick Hopefully this helps someone else who may be having the same issue. |
This helped resolve my issue: I added the below code:
|
For the record, this error is almost certainly due to the following combination of events:
In these versions of Python, SSL certificate verification is turned on by default (in previous versions, it was turned off by default). The solution is to update your OS' certificate database, which differs greatly per OS. For more information: |
I also encountered an error.
version.
Once I enabled disable_ssl_validation. |
Also when I enable disable_ssl_validation I get this error,
Is anyone familiar with this error ? Fixed it by adding this.
|
Hello, I get the same error. This is my Script: if name == 'main': Error: Does anyone know what the error is? Cheers, |
Why is it closed ? Is the issue resolved ? |
in the link https://google.com we leave it as http and solved. At least that was my case :P |
Heads up!
We appreciate any bug reports or other contributions, but please note that this issue
tracker is only for this client library. We do not maintain the APIs that this client
library talks to. If you have an issue or questions with how to use a particular API,
you may be better off posting on Stackoverflow under the
google-api
tag. If youare reporting an issue or requesting a feature for a G Suite API, please use their
public issue tracker
Thank you!
The text was updated successfully, but these errors were encountered: