summaryrefslogtreecommitdiff
path: root/sleekxmpp/features/feature_mechanisms/mechanisms.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-08-14 11:06:54 -0700
committerLance Stout <lancestout@gmail.com>2012-08-14 11:06:54 -0700
commita249f8736ac601dff8e5c06d850016383cc28d82 (patch)
treeaf14164b62402727d223a5a40af92197fe3b18bb /sleekxmpp/features/feature_mechanisms/mechanisms.py
parentf09adf00142a96d8537f1dbab09db708f1298452 (diff)
parentf0e1fc5aadcde96a8c8e776c77dd80e91368d216 (diff)
downloadslixmpp-a249f8736ac601dff8e5c06d850016383cc28d82.tar.gz
slixmpp-a249f8736ac601dff8e5c06d850016383cc28d82.tar.bz2
slixmpp-a249f8736ac601dff8e5c06d850016383cc28d82.tar.xz
slixmpp-a249f8736ac601dff8e5c06d850016383cc28d82.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/features/feature_mechanisms/mechanisms.py')
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index dae2f59f..c5b4c754 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -7,6 +7,7 @@
"""
import sys
+import ssl
import logging
from sleekxmpp.util import sasl
@@ -120,7 +121,12 @@ class FeatureMechanisms(BasePlugin):
result = {}
for value in values:
if value == 'encrypted':
- result[value] = 'starttls' in self.xmpp.features
+ if 'starttls' in self.xmpp.features:
+ result[value] = True
+ elif isinstance(self.xmpp.socket, ssl.SSLSocket):
+ result[value] = True
+ else:
+ result[value] = False
else:
result[value] = self.config.get(value, False)
return result