0

I've installed punjab with (python 2.7.3).

I am trying to connect to google server (gmail.com) using emite via Punjab as the intermediate.

The server seems to start fine, and I can access localhost:5280/http-bind but any connection I try to make fails. Here are logs from startup to attempting a login to a gmail.com account:

2013-01-30 01:08:58+0530 [-] Log opened.
2013-01-30 01:08:58+0530 [-] twistd 11.1.0 (C:\Python27\python.exe 2.7.3) starting up.
2013-01-30 01:08:58+0530 [-] reactor class: twisted.internet.selectreactor.SelectReactor.
2013-01-30 01:08:58+0530 [-] Site starting on 5280
2013-01-30 01:08:58+0530 [-] Starting factory <twisted.web.server.Site instance at 0x000000000364EB08>
2013-01-30 01:09:38+0530 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [29/Jan/2013:19:39:38 +0000] "GET /http-bind HTTP/1.1" 200 170 "-" "Mozilla/5.0 (Windows NT 6.
1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17"
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] HEADERS 1359488636.27:
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] {'origin': 'http://127.0.0.1:8888', 'content-length': '226', 'accept-language': 'en-US,en;q=0.8', 'accept-en
coding': 'gzip,deflate,gzip', 'accept': '*/*', 'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Sa
fari/537.17', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'host': 'localhost:5280', 'referer': 'http://127.0.0.1:8888/Engile.html?gwt.codesvr=127.0.0.1
:9997', 'pragma': 'no-cache', 'cache-control': 'no-cache', 'content-type': 'text/xml; charset=UTF-8'}
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] HTTPB POST :
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] <body to="gmail.com" content="text/xml; charset=utf-8" rid="228343" xmlns:xmpp="urn:xmpp:xbosh" ack="1" hold
="1" secure="true" xml:lang="en" wait="60" xmpp:version="1.0" ver="1.6" xmlns="http://jabber.org/protocol/httpbind" />
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] Session Created : ea15d8ba5d460c80a90371138987072b58eed580 1359488636.3
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] ================================== 1359488636.3 connect to gmail.com:5222 ==================================

2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] G:\Softwares\Libraries\punjab\punjab\session.py:85: exceptions.UserWarning: Domain argument to XMPPClientCon
nector should be bytes, not unicode
2013-01-30 01:13:56+0530 [HTTPChannel,2,127.0.0.1] Starting factory <punjab.session.Session object at 0x0000000003664390>
2013-01-30 01:13:57+0530 [-] DNSDatagramProtocol starting on 30443
2013-01-30 01:13:57+0530 [-] Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x0000000003672C18>
2013-01-30 01:13:57+0530 [DNSDatagramProtocol (UDP)] DNSDatagramProtocol starting on 24214
2013-01-30 01:13:57+0530 [DNSDatagramProtocol (UDP)] Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x0000000003672E80>
2013-01-30 01:13:57+0530 [-] (UDP Port 30443 Closed)
2013-01-30 01:13:57+0530 [-] Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x0000000003672C18>
2013-01-30 01:13:57+0530 [DNSDatagramProtocol (UDP)] DNSDatagramProtocol starting on 37666
2013-01-30 01:13:57+0530 [DNSDatagramProtocol (UDP)] Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x0000000003660908>
2013-01-30 01:13:57+0530 [-] (UDP Port 24214 Closed)
2013-01-30 01:13:57+0530 [-] Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x0000000003672E80>
2013-01-30 01:13:57+0530 [-] (UDP Port 37666 Closed)
2013-01-30 01:13:57+0530 [-] Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x0000000003660908>
2013-01-30 01:13:58+0530 [Uninitialized] SID: ea15d8ba5d460c80a90371138987072b58eed580 => SEND: "<stream:stream xmlns:stream='http://etherx.jabber.org/streams'
 xmlns='jabber:client' to='gmail.com' version='1.0'>"
2013-01-30 01:13:58+0530 [XmlStream,client] SID: ea15d8ba5d460c80a90371138987072b58eed580 => RECV: '<stream:stream from="gmail.com" id="149344C387533058" versi
on="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></
starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>X-OAUTH2</mechanism></mechanisms></stream:feature
s>'
2013-01-30 01:13:58+0530 [XmlStream,client] Wait until starttls is completed.
2013-01-30 01:13:58+0530 [XmlStream,client] [<twisted.words.protocols.jabber.xmlstream.TLSInitiatingInitializer object at 0x0000000003676AC8>]
2013-01-30 01:14:18+0530 [XmlStream,client] connect ERROR: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone
'>: Connection was closed cleanly.
        ]
2013-01-30 01:14:18+0530 [XmlStream,client] HTTPB Error 200
2013-01-30 01:14:18+0530 [XmlStream,client] HTTPB Return Error: 200 -> <body xmlns='http://jabber.org/protocol/httpbind' type='terminate' condition='remote-con
nection-failed'/>
2013-01-30 01:14:18+0530 [XmlStream,client] 127.0.0.1 - - [29/Jan/2013:19:44:17 +0000] "POST /http-bind// HTTP/1.0" 200 105 "http://127.0.0.1:8888/Engile.html?
gwt.codesvr=127.0.0.1:9997" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17"
2013-01-30 01:14:18+0530 [XmlStream,client] expire (ea15d8ba5d460c80a90371138987072b58eed580)
2013-01-30 01:14:18+0530 [XmlStream,client] 0
2013-01-30 01:14:18+0530 [XmlStream,client] SESSION -> We have expired ea15d8ba5d460c80a90371138987072b58eed580 228344 []
2013-01-30 01:14:18+0530 [XmlStream,client] SID: ea15d8ba5d460c80a90371138987072b58eed580 => SEND: '</stream:stream>'
2013-01-30 01:14:18+0530 [XmlStream,client] Stopping factory <punjab.session.Session object at 0x0000000003664390>

What is going wrong here?

Nitish Borade
  • 367
  • 3
  • 18
  • That message is thrown as a warning, so you should be able to suppress it and have punjab coerce the string to ascii. The real solution though is to create your session with an ascii-encoded host name to begin with. – Silas Ray Jan 29 '13 at 18:36
  • I am new to punjab. Please could you tell me how to - "create session with an ascii-encoded host name". I am using the following configuration host - gmail.com user - mymail@gmail.com password - password – Nitish Borade Jan 29 '13 at 18:51
  • Can you post some code? I don't know punjab myself, but I just looked up the code online and cross-referenced it against your stack trace. – Silas Ray Jan 29 '13 at 19:21
  • I was able to get over the issue. I checked with Punjab issues, it seems to be an issue with Twisted 12.3.0. So now I am using Twisted 11.1.0. But while connection to gmail I get the above error (Check error log in question) – Nitish Borade Jan 29 '13 at 19:54
  • It looks to me like it fails when trying the upgrade the socket to TLS. The path in your logs looks like you are on windows. IIRC you have to install SSL/TLS support for pythin manually on windows. – Alex Jan 30 '13 at 08:42
  • Yes, I am using Windows7. I have installed openssl for python2.7. But still the error persists – Nitish Borade Jan 30 '13 at 10:01

0 Answers0