summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2016-10-06 13:00:17 -0500
committerSam Whited <sam@samwhited.com>2016-10-06 13:00:17 -0500
commit8b06aa1146faa083226c69eb0aa383ef199b14a4 (patch)
tree9751a72143fdd7ee98b0d7537a5adf7712417e93
parent3c7236fe73d5fc966a6493f560634c71480aab20 (diff)
downloadslixmpp-8b06aa1146faa083226c69eb0aa383ef199b14a4.tar.gz
slixmpp-8b06aa1146faa083226c69eb0aa383ef199b14a4.tar.bz2
slixmpp-8b06aa1146faa083226c69eb0aa383ef199b14a4.tar.xz
slixmpp-8b06aa1146faa083226c69eb0aa383ef199b14a4.zip
Fix fetching the SSL socket for Python 3.4 and 3.5
-rw-r--r--slixmpp/xmlstream/xmlstream.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index a691d34c..72d2651c 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -506,7 +506,9 @@ class XMLStream(asyncio.BaseProtocol):
else:
self.event('ssl_invalid_chain', e)
else:
- der_cert = transp.get_extra_info("socket").getpeercert(True)
+ # Workaround for a regression in 3.4 where ssl_object was not set.
+ der_cert = transp.get_extra_info("ssl_object",
+ default=transp.get_extra_info("socket")).getpeercert(True)
pem_cert = ssl.DER_cert_to_PEM_cert(der_cert)
self.event('ssl_cert', pem_cert)