我很难与XMPP(Prosody)建立连接。但是,如果我使用PSI,它会正常工作,并请求您的建议。XMPP SSL握手失败
这里是我的Python代码片段:
client = xmpp.Client(host)
client.connect(server=(host,port))
client.auth(username, passwd,resource='', sasl=1)
client.sendInitPresence()
在调试模式:
DEBUG: dispatcher warn Registering protocol "error" as <class 'xmpp.protocol.Protocol'>(http://etherx.jabber.org/streams)
DEBUG: socket sent <?xml version='1.0'?><stream:stream xmlns="jabber:client" to="localhost" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" >
DEBUG: socket error Socket error while receiving data
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/xmpp/transports.py", line 161, in receive
try: received = self._recv(BUFLEN)
error: [Errno 104] Connection reset by peer
DEBUG: client stop Disconnect detected
DEBUG: socket error Socket operation failed
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/xmpp/transports.py", line 161, in receive
try: received = self._recv(BUFLEN)
error: [Errno 104] Connection reset by peer
DEBUG: socket error Socket error while receiving data
DEBUG: client stop Disconnect detected
**Prosody logs :**
Oct 20 23:46:39 c2s94ba718 info Client connected
Oct 20 23:46:39 c2s94ba718 info Client disconnected: ssl handshake failed
Oct 20 23:46:39 c2s94ba718 info Destroying session for (unknown) ((unknown)@(unknown))
Oct 20 23:48:57 c2s96052a0 info Client connected
Oct 20 23:48:57 c2s96052a0 info Client disconnected: ssl handshake failed
Oct 20 23:48:57 c2s96052a0 info Destroying session for (unknown) ((unknown)@(unknown))
在这个任何建议,将不胜感激。目标是连接到XMPP服务器并通过python加入MUC。
哪个XMPP Python包你正在使用吗? –
您可以更改日志级别以调试韵律并尝试连接,并在此处发布日志? –