Updating python to use TLS1.2 is now required (this is the problem the guys in devops encountered) and here is how to do it.
If you are using virtualenv you’ll need to deactivate it:
deactivate
then use brew to install the latest version of python and openssl:
brew install python@2
Once that is done link python to the new version:
brew link --overwrite python@2
Check you python has updated:
python -V Python 2.7.14
use `hash -r`
if you have any issues
You’ll need to recreate you virtualenvs but first update virtualenv:
pip install virtualenv
Now create your virtual env and re-run for you project:
pip install -r requirements
if you get this, check that everything has run properly:
Could not fetch URL https://pypi.python.org/simple/ansible/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]
Then you can check your version of python supports TLS1.2:
➜ python -c "import json, urllib2; print json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))['tls_version']" TLS 1.2
I found pip 9 worked best with my project:
pip install pip==9