Apologies for another pip issue, but I've tried almost every other thread and nothing so far works.
So I am having the issue that pip doesn't install any package due to using TLSv1.0
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661) - skipping
I have done the curl to download the get_pip.py script then executed it with sudo python.
I have tried downloading the pip.tar.gz manually, extracting it and installing via pip install ./pip.10.0.3
Once installed, I have done pip install --upgrade setuptools
I have installed python via Homebrew.
pip --version
pip 10.0.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip (python 2.7)
However every time I still get this TLSv1 error when attempting to install a package, and it shows I have TLS1.0 in use
python2 -c "import urllib2,json; print(json.loads(urllib2.urlopen('https://www.howsmyssl.com/a/check').read())['tls_version'])"
TLS 1.0
Running OSX 10.13.4
EDIT:
python2 -c "import ssl; print(ssl.OPENSSL_VERSION)"
OpenSSL 0.9.8zh 14 Jan 2016
$ brew upgrade openssl
Error: openssl 1.0.2o_2 already installed
EDIT2: Followed the thread here, the topmost answer and eventually worked Python referencing old SSL version
$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 1.0.2o 27 Mar 2018
This shows that a newer version of openssl is indeed installed on your system.
But this shows that Python's ssl module was compiled against an older version.
I am unfamiliar with Homebrew, but according to this issue on Homebrew's Github page, Homebrew now uses its own version of
openssl
by default.Based on this, the full steps to fix this issue would be: