简体   繁体   中英

Python - Enable TLS1.2 on OSX

I have a virtualenv environment running python 3.5

Today, when I booted up my MacBook, I found myself unable to install python packages for my Django project. I get the following error:

Could not fetch URL < package URL >: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:646) - skipping

I gather that TLS 1.0 has been discontinued, but from what I understand, newer versions of Python should be using TLS1.2, correct? Even outside of my environment, running pip3 trips the same error. I've updated to the latest version of Sierra and have updated Xcode as well. Does anyone know how to resolve this?

Here is the fix:

curl https://bootstrap.pypa.io/get-pip.py | python

Execute from within the appropriate virtual environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM