-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Ran into this today, when I was trying to update pythonz - if you're using the Apple-shipped python 2.7.10, the SSL libraries linked here don't support TLS 1.2 so github (and a lot of other HTTPS sites are refusing traffic.)
See this post on the python.org blog for more details
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib import urlretrieve
>>> urlretrieve("https://github.com/saghul/pythonz/archive/master.tar.gz", "/tmp/test.tgz")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
h.endheaders(data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders
self._send_output(message_body)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output
self.send(msg)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send
self.connect()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect
server_hostname=server_hostname)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket
_context=self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__
self.do_handshake()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)
>>> from urllib2 import urlopen
>>> req = urlopen("https://www.howsmyssl.com/a/check")
>>> import json
>>> resp = json.loads(req.readline())
>>> resp['tls_version']
"TLS 1.0"So what can you do?
- Upgrade your mac OS installation
- Install python2 or 3 using homebrew and make sure it comes in your path before the system python
- Modify
$HOME/.pythonz/bin/pythonzto explicitly call a newer python than whatever shows up first in your path. (This is what I did.)
As far as I can tell those are your only viable options. This isn't a "pythonz" issue per se, but it will stop pythonz from working correctly.
Metadata
Metadata
Assignees
Labels
No labels