0
我想要在Ubuntu 14.04上使用Python 2.7.6工作的TLS XMPP客戶端。我啓用了DEBUG模式,整個連接看起來很好,直到我收到錯誤消息error Failed SASL authentification: <incorrect-encoding />
。我通過桌面Jabber客戶端驗證了用戶和密碼帳戶。這是我正在使用的代碼。任何想法,爲什麼這不工作?:Python XMPP錯誤:失敗的SASL認證:<incorrect-encoding />
#!/usr/bin/python
import xmpp
username= 'testxmpp'
passwd = 'testtesttest'
to='jabber.somedomain.com'
msg='hello :)'
client = xmpp.Client('jabber.somedomain.com')
client.connect(server=('jabber.somedomain.com',5222))
client.auth(username, passwd, 'botty')
client.sendInitPresence()
message = xmpp.Message(to, msg)
message.setAttr('type', 'chat')
client.send(message)
這是從程序的調試輸出的摘錄:
DEBUG: socket got <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<incorrect-encoding/>
</failure>
DEBUG: dispatcher ok Got urn:ietf:params:xml:ns:xmpp-sasl/failure stanza
DEBUG: dispatcher ok Dispatching failure stanza with type-> props->[u'urn:ietf:params:xml:ns:xmpp-sasl'] id->None
DEBUG: sasl error Failed SASL authentification: <incorrect-encoding />
DEBUG: sasl stop Plugging <xmpp.auth.SASL instance at 0x7f7c40711950> out of <xmpp.client.Client instance at 0x7f7c40784c68>.
DEBUG: roster start Plugging <xmpp.roster.Roster instance at 0x7f7c40711d40> into <xmpp.client.Client instance at 0x7f7c40784c68>
DEBUG: dispatcher info Registering handler <bound method Roster.RosterIqHandler of <xmpp.roster.Roster instance at 0x7f7c40711d40>> for "iq" type->result ns->jabber:iq:roster(jabber:client)
DEBUG: dispatcher info Registering handler <bound method Roster.RosterIqHandler of <xmpp.roster.Roster instance at 0x7f7c40711d40>> for "iq" type->set ns->jabber:iq:roster(jabber:client)
DEBUG: dispatcher info Registering handler <bound method Roster.PresenceHandler of <xmpp.roster.Roster instance at 0x7f7c40711d40>> for "presence" type-> ns->(jabber:client)
DEBUG: socket sent <iq type="get" id="22">
<query xmlns="jabber:iq:roster" />