2
votes

sometimes websocket errors on sending data with this following stack trace. what configuration changes can prevent this error? alternatively, how can I handle this gracefully?

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/iostream.py", line 316, in wrapper
    callback(*args)
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/stack_context.py", line 241, in wrapped
    callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/websocket.py", line 643, in _on_masked_frame_data
    self._on_frame_data(self._apply_mask(self._frame_mask, data))
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/websocket.py", line 680, in _on_frame_data
    self._receive_frame()
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/websocket.py", line 582, in _receive_frame
    self.stream.read_bytes(2, self._on_frame_start)
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/iostream.py", line 162, in read_bytes
    self._try_inline_read()
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/iostream.py", line 398, in _try_inline_read
    if self._read_to_buffer() == 0:
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/iostream.py", line 414, in _read_to_buffer
    chunk = self.read_from_fd()
  File "/usr/local/lib/python2.7/dist-packages/tornado-3.0.1-py2.7.egg/tornado/iostream.py", line 856, in read_from_fd
    chunk = self.socket.read(self.read_chunk_size)
  File "/usr/lib/python2.7/ssl.py", line 160, in read
    return self._sslobj.read(len)
SSLError: [Errno 1] _ssl.c:1363: error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol version
1

1 Answers

0
votes

The error indicates that your client is using TLS v1. Which is no longer accepted by nginx server.

The quick fix is to enable the protocol on the server. See https://ma.ttias.be/enable-tls-1-3-nginx/ to get an idea how to do it.

Warning: TLS v1 is considered insecure!