Fix using PLAIN over older SSL method.
This commit is contained in:
parent
c6ac64ed2d
commit
f0e1fc5aad
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue