Skip to content

Instantly share code, notes, and snippets.

@seancribbs

seancribbs/python.txt

Last active Jan 2, 2016
Embed
What would you like to do?
>>> urllib.URLopener().open('https://www.howsmyssl.com/a/check')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 208, in open
return getattr(self, name)(url)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 437, in open_https
h.endheaders(data)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 969, in endheaders
self._send_output(message_body)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 829, in _send_output
self.send(msg)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 791, in send
self.connect()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1176, in connect
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 387, in wrap_socket
ciphers=ciphers)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 143, in __init__
self.do_handshake()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 305, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [Errno 1] _ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
>>> sys.version
'2.7.6 (default, Nov 22 2013, 14:50:42) \n[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)]'
$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
~
$ irb -rexcon
irb(main):001:0> Excon.get("https://howsmyssl.com/a/check")
Excon::Errors::SocketError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (OpenSSL::SSL::SSLError)
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/ssl_socket.rb:77:in `connect'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/ssl_socket.rb:77:in `initialize'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/connection.rb:410:in `new'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/connection.rb:410:in `socket'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/connection.rb:122:in `request_call'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/middlewares/mock.rb:42:in `request_call'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/middlewares/base.rb:15:in `request_call'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/middlewares/base.rb:15:in `request_call'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/middlewares/base.rb:15:in `request_call'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon/connection.rb:265:in `request'
from /usr/local/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/excon-0.31.0/lib/excon.rb:244:in `get'
from (irb):1
from /usr/local/opt/rbenv/versions/1.9.3-p448/bin/irb:12:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.