-
Notifications
You must be signed in to change notification settings - Fork 8
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
SSLError: certificate verify failed #5
Comments
Consider using SecureTransport if the linked OpenSSL doesn't support SNI, and print a warning if either SecureTransport or pyOpenSSL cannot be injected. Related to #5
Thanks for trying my fork! The relevant code was inspired by wget but it actually uses urllib3 under the hood. This error has the same meaining as the one in bbolli#225, see my comment for more info. I just reviewed the code and pushed some changes that should either fix the problem or print a warning if something isn't working. If you still get those errors with the latest script, show me the lines it prints at the top that start with python -c 'from __future__ import print_function; import ssl, sys; print("Python " + sys.version + " on " + sys.platform, ssl.OPENSSL_VERSION, hex(ssl.OPENSSL_VERSION_NUMBER), getattr(ssl, "HAS_SNI", None), sep="\n")' |
Thanks for taking the time to reply. Here is the result of the command: Python2:
Python3:
I was able to get your version running with the Thanks again for your help. |
Using Which Python version have you been using to run the script? Your Python 2 install is linked to an old OpenSSL version that doesn't support TLS 1.2 and might have other issues, but your Python 3 install looks relatively up-to-date (though 3.8.8 would be better). This fork supports both versions, but Python 3 is recommended because Python 2 is no longer being updated. |
I'm using python 3 to run the script since python 2 looks like a mess on OSX. |
I looked into the specific exception you're getting, and it turns out it comes from urllib3's pyOpenSSL wrapper ( But pyOpenSSL shouldn't even be in use, since both of your Python versions report HAS_SNI as True. The standard Run this to make sure you have urllib3 installed: python3 -m pip install urllib3 Run this to find where python3 -c 'from urllib3.contrib import pyopenssl; print(pyopenssl.__file__)' It will print a path like def inject_into_urllib3():
"Monkey-patch urllib3 with PyOpenSSL-backed SSL-support."
raise RuntimeError('Somebody called me')
_validate_dependencies_met() Then save that file and try to backup some blog with |
So I added the
I get the following response when I run the |
Ah, apparently requests versions prior to v2.24.0 (released Jun 17, 2020) lack commit psf/requests@db47b9b and inject pyOpenSSL unconditionally. |
Awesome, that did the trick! Thanks so much for helping me resolve this. |
Hi @cebtenzzre,
Thanks for your response on my issue on the other repo. I've moved everything across to your fork but a different problem has cropped up. I get the following error for all the sites I try:
[wget] URL is https://66.media.tumblr.com/tumblr_DETAIL.jpg [wget] Error retrieving resource: urllib3 reached a retry limit. Caused by: WGHTTPSConnectionPool(host='66.media.tumblr.com', port=443): Max retries exceeded with url: /tumblr_DETAIL.jpg (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
I'm guessing this might not be related to your script at all. I would appreciate it if you could point me in the right direction to try and resolve this. I'm on OSX 10.14.6. I have tried running the
wget
command by itself and that seems to work fine.Please let me know if you need more information.
The text was updated successfully, but these errors were encountered: