diff options
author | mathieui <mathieui@mathieui.net> | 2018-08-07 23:20:38 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2018-08-07 23:20:38 +0200 |
commit | 7738a01311bdac1575dea89bda9eb9dac55debc0 (patch) | |
tree | 9e84adf46dc223c582d1e03289e1050b583d969a /slixmpp/features | |
parent | a9abed615188bff2da7cf7865e07fe1aefa24b61 (diff) | |
download | slixmpp-7738a01311bdac1575dea89bda9eb9dac55debc0.tar.gz slixmpp-7738a01311bdac1575dea89bda9eb9dac55debc0.tar.bz2 slixmpp-7738a01311bdac1575dea89bda9eb9dac55debc0.tar.xz slixmpp-7738a01311bdac1575dea89bda9eb9dac55debc0.zip |
Fix TLS with python 3.7
Use the "new" sslproto API instead of the deprecated TLS API.
Also remove the unused "socket" parameter in XMLStream.__init__.
Diffstat (limited to 'slixmpp/features')
-rw-r--r-- | slixmpp/features/feature_starttls/starttls.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/slixmpp/features/feature_starttls/starttls.py b/slixmpp/features/feature_starttls/starttls.py index d472dad7..7e3af992 100644 --- a/slixmpp/features/feature_starttls/starttls.py +++ b/slixmpp/features/feature_starttls/starttls.py @@ -12,7 +12,7 @@ from slixmpp.stanza import StreamFeatures from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins import BasePlugin from slixmpp.xmlstream.matcher import MatchXPath -from slixmpp.xmlstream.handler import Callback +from slixmpp.xmlstream.handler import CoroutineCallback from slixmpp.features.feature_starttls import stanza @@ -28,7 +28,7 @@ class FeatureSTARTTLS(BasePlugin): def plugin_init(self): self.xmpp.register_handler( - Callback('STARTTLS Proceed', + CoroutineCallback('STARTTLS Proceed', MatchXPath(stanza.Proceed.tag_name()), self._handle_starttls_proceed, instream=True)) @@ -58,8 +58,8 @@ class FeatureSTARTTLS(BasePlugin): self.xmpp.send(features['starttls']) return True - def _handle_starttls_proceed(self, proceed): + async def _handle_starttls_proceed(self, proceed): """Restart the XML stream when TLS is accepted.""" log.debug("Starting TLS") - if self.xmpp.start_tls(): + if await self.xmpp.start_tls(): self.xmpp.features.add('starttls') |