diff --git a/kafka/conn.py b/kafka/conn.py index 4d56964e3..6c74db623 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -467,6 +467,9 @@ def _try_handshake(self): # old ssl in python2.6 will swallow all SSLErrors here... except (SSLWantReadError, SSLWantWriteError): pass + # python 3.7 throws OSError + except OSError: + pass except (SSLZeroReturnError, ConnectionError, SSLEOFError): log.warning('SSL connection closed by server during handshake.') self.close(Errors.KafkaConnectionError('SSL connection closed by server during handshake'))