When executing different scripts with Python 2.7.14, I keep running into Errors that seem to lead back to my OpenSSL installation.
E.g. when using requests
:
requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:661)
I'm on:
- Python 2.7.14
- MacOS Mojave Version 10.14.3
- NOT using homebrew ! (and would prefer not to)
Mac OS uses LibreSSL:
$ openssl version -a
LibreSSL 2.6.5
built on: date not available
platform: information not available
options: bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) blowfish(idx)
compiler: information not available
OPENSSLDIR: "/private/etc/ssl"
$ which openssl
/usr/bin/openssl
However, my Python installations (from source) both use OpenSSL - two different versions:
$ python2.7 -c 'import ssl; print ssl.OPENSSL_VERSION'
OpenSSL 0.9.8zh 14 Jan 2016
$ python3.7 -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.1.0i 14 Aug 2018
I want to update the OpenSSL used with Python 2.7 without using homebrew
(nor Anaconda), and without using an additional package, such as pyOpenSSL
.
Most solutions I can find online suggest using homebrew
and therefore don't answer my question:
- Updating openssl in python 2.7
- https://apple.stackexchange.com/questions/126830/how-to-upgrade-openssl-in-os-x
- https://medium.com/@katopz/how-to-upgrade-openssl-8d005554401
None of my Python versions are installed using homebrew
and I'd like to stay clean from further complicating my OS setup.
Considering that different versions of OpenSSL are installed, should I follow this suggestion and link Python 2.7 to the newer OpenSSL version?
- Is that the best way to move forward?
- What can go wrong?
- What are viable alternatives?
- Any good resource for learning to navigate the SSL-Python-jungle on Mac?