Commit 93a77758 authored by Sam Rushing's avatar Sam Rushing

tlslite_server.accept(): toss connections that raise TLSAbruptCloseError

parent f5fcd18c
...@@ -492,7 +492,7 @@ class server: ...@@ -492,7 +492,7 @@ class server:
except coro.Shutdown: except coro.Shutdown:
break break
except: except:
self.log ('error: %r\n' % (coro.compact_traceback(),)) self.log ('error: %r' % (coro.compact_traceback(),))
coro.sleep_relative (0.25) coro.sleep_relative (0.25)
continue continue
self.sock.close() self.sock.close()
...@@ -526,9 +526,14 @@ class tlslite_server (server): ...@@ -526,9 +526,14 @@ class tlslite_server (server):
def accept (self): def accept (self):
import tlslite import tlslite
while 1:
conn0, addr = server.accept (self) conn0, addr = server.accept (self)
conn = tlslite.TLSConnection (conn0) conn = tlslite.TLSConnection (conn0)
try:
conn.handshakeServer (certChain=self.chain, privateKey=self.private, **self.handshake_args) conn.handshakeServer (certChain=self.chain, privateKey=self.private, **self.handshake_args)
except tlslite.errors.TLSAbruptCloseError:
self.log ('TLSAbruptCloseError: %r' % (addr,))
else:
return conn, addr return conn, addr
def read_chain (self): def read_chain (self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment