Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sockets stopped connecting with SNI-related error (python2.7) #424

Open
Tectract opened this issue Feb 15, 2021 · 1 comment
Open

Sockets stopped connecting with SNI-related error (python2.7) #424

Tectract opened this issue Feb 15, 2021 · 1 comment

Comments

@Tectract
Copy link

Running the websocket client test code from the readme, I'm getting a SNI-related connection error now. It seems that Coinbase has enabled SNI on their servers and python2.7 clients may not be able to connect anymore. This problem is REALLY hard to troubleshoot for python2.7.6 users! I'm sort of locked to an OS that runs on python2.7 for the moment so I need to get around this somehow.

How can I write a simple tool that will run under python3 here, just connect to a websocket print out the lines to the command-line? Can anyone help?

For reference the error I'm seeing under python2.7.6 now is this:

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/myusername/.local/lib/python2.7/site-packages/cbpro/websocket_client.py", line 40, in _go
    self._connect()
  File "/home/myusername/.local/lib/python2.7/site-packages/cbpro/websocket_client.py", line 72, in _connect
    self.ws = create_connection(self.url)
  File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 487, in create_connection
    websock.connect(url, **options)
  File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 211, in connect
    options.pop('socket', None))
  File "/usr/local/lib/python2.7/dist-packages/websocket/_http.py", line 77, in connect
    sock = _ssl_socket(sock, options.sslopt, hostname)
  File "/usr/local/lib/python2.7/dist-packages/websocket/_http.py", line 182, in _ssl_socket
    sock = ssl.wrap_socket(sock, **sslopt)
  File "/usr/lib/python2.7/ssl.py", line 487, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 243, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 405, in do_handshake
    self._sslobj.do_handshake()
SSLError: [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
@Tectract
Copy link
Author

relevant issue in ws4py implementation of websockets, which I also debugged for ws-feed.pro.coinbase.com websocket connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant