do TLS handshake without blocking. Fixes #7250
This commit is contained in:
parent
2bc9f743b3
commit
6a8737bcd5
|
@ -418,13 +418,13 @@ class NonBlockingTLS(PlugIn):
|
||||||
tcpsock._send = wrapper.send
|
tcpsock._send = wrapper.send
|
||||||
|
|
||||||
log.debug("Initiating handshake...")
|
log.debug("Initiating handshake...")
|
||||||
tcpsock._sslObj.setblocking(True)
|
|
||||||
try:
|
try:
|
||||||
tcpsock._sslObj.do_handshake()
|
tcpsock._sslObj.do_handshake()
|
||||||
|
except (OpenSSL.SSL.WantReadError, OpenSSL.SSL.WantWriteError), e:
|
||||||
|
pass
|
||||||
except:
|
except:
|
||||||
log.error('Error while TLS handshake: ', exc_info=True)
|
log.error('Error while TLS handshake: ', exc_info=True)
|
||||||
return False
|
return False
|
||||||
tcpsock._sslObj.setblocking(False)
|
|
||||||
self._owner.ssl_lib = PYOPENSSL
|
self._owner.ssl_lib = PYOPENSSL
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue