requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:600)
I have change the terminal's openssl version,
kingwangdeMini:icampuslist_web kingwang$ openssl version
OpenSSL 1.0.2d 9 Jul 2015
but my python's openssl version is still old version:
kingwangdeMini:icampuslist_web kingwang$ python -c "import ssl; print(ssl.OPENSSL_VERSION)"
OpenSSL 0.9.8zg 14 July 2015
I know that [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] 's bug is because of the version error.
I want to know that how to change my python's openssl version~
thanks!
Your Python's OpenSSL version is what it is compiled against. In this case, for Mac OS X, you'll need to compile yourself a new Python. The easiest way to do that is to use Homebrew: brew install python
will provide you with a new Python that has a more modern OpenSSL.
You can also fix the bug for yourself by running pip install pyasn1 ndg-httpsclient pyopenssl
, which will also give you a newer OpenSSL that only Requests can use.
This is my first use github to solve issue.
@Lukasa
Thank you! And my bug solved now.
I use the pyenv to run the python. and I uninstall the python, then install again. It's working! So happy~~
By the way, I tried the second method firstly, but It not working. Then I tried the first one.I didn't know the reason. Maybe I had already installed that packages.
Finally, Thanks very much!
Most helpful comment
Your Python's OpenSSL version is what it is compiled against. In this case, for Mac OS X, you'll need to compile yourself a new Python. The easiest way to do that is to use Homebrew:
brew install python
will provide you with a new Python that has a more modern OpenSSL.You can also fix the bug for yourself by running
pip install pyasn1 ndg-httpsclient pyopenssl
, which will also give you a newer OpenSSL that only Requests can use.