summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-21 01:01:59 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-21 01:02:06 +0100
commit41419a21613bd17f58965840340251872603a2e4 (patch)
tree641c9fda0498e5cbab4c53515e4b088deaccee8f
parent7cd73b594e8122dddf847953fcfc85ab4d316416 (diff)
downloadslixmpp-41419a21613bd17f58965840340251872603a2e4.tar.gz
slixmpp-41419a21613bd17f58965840340251872603a2e4.tar.bz2
slixmpp-41419a21613bd17f58965840340251872603a2e4.tar.xz
slixmpp-41419a21613bd17f58965840340251872603a2e4.zip
Fix authenticating on a non-TLS socket.
This was broken since c1562b76b273cc7aeaaa1cf8fddd3dca2c828c4d.
-rw-r--r--slixmpp/features/feature_mechanisms/mechanisms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/slixmpp/features/feature_mechanisms/mechanisms.py b/slixmpp/features/feature_mechanisms/mechanisms.py
index 30449de0..26af1947 100644
--- a/slixmpp/features/feature_mechanisms/mechanisms.py
+++ b/slixmpp/features/feature_mechanisms/mechanisms.py
@@ -97,7 +97,10 @@ class FeatureMechanisms(BasePlugin):
jid = self.xmpp.requested_jid.bare
result[value] = creds.get('email', jid)
elif value == 'channel_binding':
- result[value] = self.xmpp.socket.get_channel_binding()
+ if isinstance(self.xmpp.socket, (ssl.SSLSocket, ssl.SSLObject)):
+ result[value] = self.xmpp.socket.get_channel_binding()
+ else:
+ result[value] = None
elif value == 'host':
result[value] = creds.get('host', self.xmpp.requested_jid.domain)
elif value == 'realm':