diff --git a/src/common/xmpp/tls_nb.py b/src/common/xmpp/tls_nb.py index cde9d4c43..b04e7ad00 100644 --- a/src/common/xmpp/tls_nb.py +++ b/src/common/xmpp/tls_nb.py @@ -165,6 +165,10 @@ class PyOpenSSLWrapper(SSLWrapper): log.debug("Recv: Got OpenSSL.SSL.SysCallError: " + repr(e), exc_info=True) raise SSLWrapper.Error(self.sock or self.sslobj, e) + except OpenSSL.SSL.ZeroReturnError, e: + # end-of-connection raises ZeroReturnError instead of having the + # connection's .recv() method return a zero-sized result. + raise SSLWrapper.Error(self.sock or self.sslobj, e, -1) except OpenSSL.SSL.Error, e: if self.is_numtoolarge(e): # warn, but ignore this exception