SSL error with Python requests despite up-to-date dependencies

后端 未结 3 437
天涯浪人
天涯浪人 2020-11-30 05:50

I am getting an SSL \"bad handshake\" error. Most similar responses to this problem seem to stem from old libraries, 1024bit cert. incompatibility, etc... I think

3条回答
  •  伪装坚强ぢ
    2020-11-30 06:54

    I fixed it using the python-certifi-win32 package:

    pip install python-certifi-win32
    

    or with anaconda

    conda install -c conda-forge python-certifi-win32
    

    then you can use:

    requests.get(url)
    #or
    requests.get(url, verify=True)
    

    and the certificate is checked using the Windows Certificate Store.

    This only works if the certificate is installed in the Windows Certificate Store.

提交回复
热议问题