python: certificate verified failed

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:

As an example, here is the code with a Python shell

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 ( his may work for other systems so here is the solution that worked for me:

This entry was posted in Python and tagged , . Bookmark the permalink.

14 Responses to python: certificate verified failed

  1. Pingback: Quicky: If Python and OpenSSL hate each other – 0daylego

  2. Anonymous says:

    Thanks. Had a similar issue.

  3. Anonymous says:

    it worked!

  4. MRF says:

    Thanks. It worked.

  5. kodi says:

    Great & Thanks.

  6. Abe says:

    Many thanks, you saved my time

  7. kino says:

    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

  8. Kim says:

    I spent hours looking for a solution to this problem. Thanks to you I finally got back to my coding class! Thanks a lot

  9. Al says:

    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context

    This one did the trick – ignore SSL certificate verification!

  10. Mike says:

    You saved my bacon, this was annoying the living hell out of me

  11. Zen says:

    Thanks a lot it works

  12. shobhit says:

    thanks a lot , it worked for me

  13. Anonymous says:

    you are my hero

  14. egigoka says:

    Thank you very much!

Leave a Reply

Your email address will not be published.