From 572becad44b8cb577a1f8357e04fa93235894536 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 9 Aug 2011 00:51:49 -0700 Subject: Enable forcing a specififc SASL mech: xmpp = ClientXMPP(jid, password, { 'feature_mechanisms': {'use_mech':'PLAIN'}}) --- sleekxmpp/features/feature_mechanisms/mechanisms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/features') diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py index 2debf3be..a6cff0a0 100644 --- a/sleekxmpp/features/feature_mechanisms/mechanisms.py +++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py @@ -29,6 +29,8 @@ class feature_mechanisms(base_plugin): self.description = "SASL Stream Feature" self.stanza = stanza + self.use_mech = self.config.get('use_mech', None) + def tls_active(): return 'starttls' in self.xmpp.features @@ -48,7 +50,8 @@ class feature_mechanisms(base_plugin): username=self.xmpp.boundjid.user, sec_query=suelta.sec_query_allow, request_values=sasl_callback, - tls_active=tls_active) + tls_active=tls_active, + mech=self.use_mech) register_stanza_plugin(StreamFeatures, stanza.Mechanisms) -- cgit v1.2.3