features/starttls: handle the case where the socket is an sslobject

Thanks pep.
This commit is contained in:
mathieui 2018-08-07 23:30:06 +02:00
parent 7738a01311
commit 20107ad516
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -116,7 +116,7 @@ class FeatureMechanisms(BasePlugin):
if value == 'encrypted':
if 'starttls' in self.xmpp.features:
result[value] = True
elif isinstance(self.xmpp.socket, ssl.SSLSocket):
elif isinstance(self.xmpp.socket, (ssl.SSLSocket, ssl.SSLObject)):
result[value] = True
else:
result[value] = False