AttributeError after failing to handle SSLError
aaliddell opened this issue · 0 comments
aaliddell commented
If a server is setup with SSL enabled and receives an invalid connection (non-SSL connection in this case), the following sequence of exceptions occurs:
SSL handshake failed
protocol: <uvloop.loop.SSLProtocol object at 0x7f0645e49bc8>
transport: <TCPTransport closed=False reading=False 0x27efa38>
Traceback (most recent call last):
File "uvloop/sslproto.pyx", line 500, in uvloop.loop.SSLProtocol._on_handshake_complete
File "uvloop/sslproto.pyx", line 484, in uvloop.loop.SSLProtocol._do_handshake
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:852)
Exception in callback <bound method H2Protocol.connection_lost of <grpclib.protocol.H2Protocol object at 0x7f0644d921d0>>
handle: <Handle H2Protocol.connection_lost>
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 68, in uvloop.loop.Handle._run
File "<snip>/grpclib/grpclib/protocol.py", line 635, in connection_lost
self.processor.close()
AttributeError: 'H2Protocol' object has no attribute 'processor'
The SSLError appears to prevent the processor
from getting created on the H2Protocol object, leading to another error when the connection closes. Either the SSLError should be handled in connection_made
(may not be possible, looking by stack trace), or connection_lost
should check that processor
exists.