I was just trying to download a file on github (raw) using wget package (or curl) under Python2.7.11 and Windows 7. I got a certificate error as follows:
IOError: [Errno socket error] [ SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) |
As an example, here is the code with a Python shell
import wget wget.download("https://valid_url_link") |
This is not an issue with the tool wget since I got the same message in a windows shell with curl.
After quite a lot of time on stackoverflow and other resources, I finally found a solution on a github page (https://github.com/servo/servo/issues/5917). his may work for other systems so here is the solution that worked for me:
import wget import ssl ssl._create_default_https_context = ssl._create_unverified_context wgte.download("https://valid_url_link") |
Please follow and like us:
Pingback: Quicky: If Python and OpenSSL hate each other – 0daylego
Thanks. Had a similar issue.
it worked!
Thanks. It worked.
Great & Thanks.
Many thanks, you saved my time
Thanx…. i try to find this solution in many sites…. some came with a lot of code’s line, and still result unexpected..
but in this blog, you give me just 4 line of codes … and it works like magic ..
Blessed your day
I spent hours looking for a solution to this problem. Thanks to you I finally got back to my coding class! Thanks a lot
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
This one did the trick – ignore SSL certificate verification!
You saved my bacon, this was annoying the living hell out of me
Thanks a lot it works
thanks a lot , it worked for me
you are my hero
Thank you very much!
Thank you so much! It saved me from combing the web for hours more to find a solution.
Omg ! 🙂 this great thank you
Awesome. Works great. Many thanks!
What’s the solution when I run “python -m wget url_name” I have the same issue.
indeed, several comments reported this error. I have now updated the content of the section related to python 3.6.
The main message being that in python 3.6 dictionary keeps insertion sorted, which means you do not need to sort them if one takes care of the sorting. Of course, if insertion are not sorted, you still need to perform the sorting.
Thanks, you saved my time
Thank god! I was gonna throw my computer into a fire