From 96ff2d43c057c1aabdb735f3a0150d3a99fb0db6 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 13 Mar 2012 12:24:41 -0700 Subject: [PATCH] Explicitly set the desired SASL mech to ANONYMOUS if no username is provided. --- sleekxmpp/features/feature_mechanisms/mechanisms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py index 3818c70e..6f01cb14 100644 --- a/sleekxmpp/features/feature_mechanisms/mechanisms.py +++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py @@ -32,6 +32,9 @@ class FeatureMechanisms(BasePlugin): def plugin_init(self): self.use_mech = self.config.get('use_mech', None) + if not self.use_mech and not self.xmpp.boundjid.user: + self.use_mech = 'ANONYMOUS' + def tls_active(): return 'starttls' in self.xmpp.features