SSL error : routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

后端 未结 7 1955
梦毁少年i
梦毁少年i 2020-12-15 03:56

I have a large number of file download links in a txt file. I am trying to write a python script to download all the files at once, but I end up wi

相关标签:
7条回答
  • 2020-12-15 04:25

    could also happen when your local time is off (e.g. before certificate validation time), this was the case in my error...

    0 讨论(0)
  • 2020-12-15 04:26

    I've experienced the same issue because of certifi library. Installing a different version helped me as well.

    0 讨论(0)
  • 2020-12-15 04:29

    Normally updating certifi and/or the certifi cacert.pem file would work. I also had to update my version of python. Vs. 2.7.5 wasn't working because of how it handles SNI requests.

    Once you have an up to date pem file you can make your http request using:

    requests.get(url, verify='/path/to/cacert.pem')

    0 讨论(0)
  • 2020-12-15 04:31

    The server certificate is invalid, either because it is signed by an invalid CA (internal CA, self signed,...), doesn't match the server's name or because it is expired.

    Either way, you need to find how to tell to the Python library that you are using that it must not stop at an invalid certificate if you really want to download files from this server.

    0 讨论(0)
  • 2020-12-15 04:34

    Got this same error recently in a python app using requests on ubuntu 14.04LTS, that I thought had been running fine (maybe it was and some update occurred). Doing the steps below fixed it for me:

    pip install --upgrade setuptools
    pip install -U requests[security]
    

    Here is a reference: https://stackoverflow.com/a/39580231/996117

    0 讨论(0)
  • 2020-12-15 04:46

    Experienced this myself when using requests:

    This is extremely insecure; use only as a last resort! (See rdlowrey's comment.)

    requests.get('https://github.com', verify=True)
    

    Making that verify=False did the trick for me.

    0 讨论(0)
提交回复
热议问题