summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-01-24 10:30:45 +0100
committermathieui <mathieui@mathieui.net>2021-01-24 10:30:45 +0100
commit0bf1b9685958ff2eefdfc3e72658534077979c3b (patch)
tree5582698edb47275ea77deb6aa38a657f5f11a897
parentb784b68bcdface791f2a6e0e0a5482096b03ee06 (diff)
parent49577e6c84ef717022884fdc13a13a584a66cf3c (diff)
downloadslixmpp-0bf1b9685958ff2eefdfc3e72658534077979c3b.tar.gz
slixmpp-0bf1b9685958ff2eefdfc3e72658534077979c3b.tar.bz2
slixmpp-0bf1b9685958ff2eefdfc3e72658534077979c3b.tar.xz
slixmpp-0bf1b9685958ff2eefdfc3e72658534077979c3b.zip
Merge branch 'handle-connection-errors-in-starttls' into 'master'
Handle connection errors in start_tls (fix #3449) Closes #3449 See merge request poezio/slixmpp!101
-rw-r--r--slixmpp/xmlstream/xmlstream.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index dc2af77e..6b890729 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -622,6 +622,10 @@ class XMLStream(asyncio.BaseProtocol):
else:
self.event('ssl_invalid_chain', e)
return False
+ except OSError as exc:
+ log.debug("Connection error:", exc_info=True)
+ self.disconnect()
+ return False
der_cert = transp.get_extra_info("ssl_object").getpeercert(True)
pem_cert = ssl.DER_cert_to_PEM_cert(der_cert)
self.event('ssl_cert', pem_cert)