diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2012-10-28 19:59:11 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2012-10-28 19:59:11 +0400 |
commit | 6a8737bcd51080e6e3e0f745dd7bb5b532562d88 (patch) | |
tree | bb1913cccdb57aef059c9b1f5899b913ba202e7d /src/common/xmpp | |
parent | 2bc9f743b38e2be2f68cdbc041a854d842c75d9a (diff) |
do TLS handshake without blocking. Fixes #7250
Diffstat (limited to 'src/common/xmpp')
-rw-r--r-- | src/common/xmpp/tls_nb.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/xmpp/tls_nb.py b/src/common/xmpp/tls_nb.py index 575960fca..9425bcf17 100644 --- a/src/common/xmpp/tls_nb.py +++ b/src/common/xmpp/tls_nb.py @@ -418,13 +418,13 @@ class NonBlockingTLS(PlugIn): tcpsock._send = wrapper.send log.debug("Initiating handshake...") - tcpsock._sslObj.setblocking(True) try: tcpsock._sslObj.do_handshake() + except (OpenSSL.SSL.WantReadError, OpenSSL.SSL.WantWriteError), e: + pass except: log.error('Error while TLS handshake: ', exc_info=True) return False - tcpsock._sslObj.setblocking(False) self._owner.ssl_lib = PYOPENSSL return True |