Connection issue with twisted / wokkel when running locally

547 Views Asked by At

I've created a simple XMPP robot with the twisted/wokkel lib. It works wonderfully when I run it on my local machine connecting to a foreign XMPP server. However, when I run the twisted script from the xmpp machine itself it immediately refuses the connection (or drops it).

I was able to disable TLS on ejabberd, and the issue went away. Of course, this is not a viable solution but may provide some insight to the solution. The 'reason' being passed to wokkels connectionLost method is simply None.

Any suggestions would be greatly appreciated!

(here's the error when running from the same machine as jabber):

2011-07-07 22:01:52+0000 [-] Log opened.
2011-07-07 22:01:52+0000 [-] twistd 11.0.0 (/usr/bin/python2.6 2.6.6) starting up.
2011-07-07 22:01:52+0000 [-] reactor class: twisted.internet.selectreactor.SelectReactor.
2011-07-07 22:01:52+0000 [-] Starting factory <twisted.words.protocols.jabber.xmlstream.XmlStreamFactory object at 0x169df50>
2011-07-07 22:01:52+0000 [XmlStream,client] Connection lost: None
2011-07-07 22:01:52+0000 [XmlStream,client] <twisted.internet.tcp.Connector instance at 0x1120dd0> will retry in 2 seconds
2011-07-07 22:01:52+0000 [XmlStream,client] Stopping factory <twisted.words.protocols.jabber.xmlstream.XmlStreamFactory object at 0x169df50>
2011-07-07 22:01:52+0000 [-] Main loop terminated.
2011-07-07 22:01:52+0000 [-] Server Shut Down.
2

There are 2 best solutions below

0
On

If you are using XMPPClient, try setting its logTraffic attribute to True. Then, all the traffic sent and received while connected is logged, maybe providing a hint of what's going on.

0
On

Sounds like you don't have the Python OpenSSL libs installed or in your python path, try installing python-openssl (Debian/Ubuntu package name) or your server distro equivalent. Twisted starts up without it it just disables TLS and SSL functionality.

If you do have Python's OpenSSL libs, it's likely to be a weird handshake issue as Peter says. Is there anything in the ejabbered logs?