def handle_read(self):
while True:
try:
asynchat.async_chat.handle_read(self)
except (ssl.SSLWantReadError, ssl.SSLWantWriteError):
self._handshake()
else:
break