[Tsung] Tsung and XMPP Anonymous Connections

Karthik Kailash karthik at socialvisioninc.com
Sun Jan 31 21:29:27 CET 2010


Actually, this is explained in the spec (RFC3290):
http://xmpp.org/rfcs/rfc3920.html#streams , section 4.4 and 4.6 -- servers
are only supposed to send a stream features element if the client specifies
a version of at least "1.0".

When I add the version="1.0" element to connect/1 in ts_jabber_common.erl,
it works perfectly and I don't have to use the raw XML anymore.  I attached
a patch for this -- diffed against latest version of trunk.  This patch also
includes the changes in sasl.patch in TSUN-135 and the patch that Nicolas
attached in his other e-mail in this thread.

Thanks for helping me solve this problem!

Cheers,
Karthik

Karthik Kailash | Product
SocialVision, Online Television Becomes a Social Experience
CELL • 408.768.7704  | WEB • www.socialvisioninc.com | FACEBOOK •
facebook.com/socialvision | TWITTER • twitter.com/socialvision


-----Original Message-----
From: Karthik Kailash [mailto:karthik at socialvisioninc.com] 
Sent: Saturday, January 30, 2010 3:50 PM
To: 'Nicolas Niclausse'
Cc: 'tsung-users at lists.process-one.net'
Subject: RE: [Tsung] Tsung and XMPP Anonymous Connections

Hi Nicolas,

Thanks for pointing out the error in my file!  I can't believe I missed
that.  I will fix it and let you know how it works.

In the meantime, I tried applying the patch you gave, but still can't get
the stream features back from ejabberd.  The following is the stream opening
XML that Tsung sends with the new patch: 

<?xml version='1.0'?><stream:stream  id='1' to='ejabberd-test'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

When I simulate the above in raw XML, and add a version="1.0" attribute to
the stream element, then ejabberd responds with the stream features.  I
think if you patch Tsung to include this attribute when sending out a stream
opening tag, it should work.

Karthik

Karthik Kailash | Product
SocialVision, Online Television Becomes a Social Experience
CELL • 408.768.7704  | WEB • www.socialvisioninc.com | FACEBOOK •
facebook.com/socialvision | TWITTER • twitter.com/socialvision


-----Original Message-----
From: Nicolas Niclausse [mailto:nicolas at niclux.org] 
Sent: Saturday, January 30, 2010 2:19 PM
To: Karthik Kailash
Cc: 'tsung-users at lists.process-one.net'
Subject: Re: [Tsung] Tsung and XMPP Anonymous Connections

Karthik Kailash ecrivait le 30/01/2010 09:33:
> Hi,
> 
> I haven't been able to get this to work yet.  There are a few problems 
> that I have found so far when testing with ejabberd:
> 
> 1. When using the regular <jabber type="connect" ack="local">, 
> ejabberd never sends the stream features back.  When I changed from 
> this to sending raw XML, it worked: <jabber type="raw" ack="local" 
> data='&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;stream:stream
xmlns="jabber:client"
> xmlns:stream="http://etherx.jabber.org/streams" to="ejabberd-test"
> xml:lang="en" version="1.0"&gt;'></jabber>


see attached patch (must be applied after the first sasl patch) to fix this
issue (add <xml ...> before <stream>) and the loop

> 2.  I attached my tsung.dump file containing the traffic logged after 
> changing "connect" calls to raw XML.
> 
> You can see that the order of doing things is somewhat off, as the 
> Tsung sends the stream restart before it receives the auth success.  
> After the documented traffic in tsung.dump, some very weird behavior 
> occurs.  Tsung goes into a loop where it starts spamming ejabberd like 
> crazy (my test is currently only configured to use 1 client, see 
> attached configuration xml file).

First, there is an arror in your config file that explains the infinite
loop:

jabber type="auth_sasl_" does not exists; ( after the bind, it should be
jabber type="auth_sasl_session")

you should set a thinktime (a small one: 1 sec for ex.) to avoid sending the
stream restart before the server sends the <stream:features>

somethink like that should work:

    <request>
        <jabber type="connect" ack="local"></jabber>
    </request>

     <thinktime value="1"></thinktime>

        <transaction name="authenticate">
        <request>
                <jabber type="auth_sasl_anonymous" ack="local"></jabber>
        </request>

        <request>
                <jabber type="connect" ack="local"></jabber>
        </request>
        <request>
                <jabber type="auth_sasl_bind" ack="local"></jabber>
        </request>
        <request>
                <jabber type="auth_sasl_session" ack="local"></jabber>
        </request>
        </transaction>

--
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts_jabber_common.patch
Type: application/octet-stream
Size: 4015 bytes
Desc: not available
Url : http://lists.process-one.net/pipermail/tsung-users/attachments/20100131/180f26fb/attachment.obj 


More information about the Tsung-users mailing list