Not logged in. · Lost password · Register
Forum: XMPP Protocol RSS
Avatar
elyoni #1
Member since Aug 2012 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Stream XML TO connect Gtalk Server
Hello
I am a labview developer, and there is no XMPP library for labview, then i need to build my on library.

i started to read the book "XMPP: The Definitive Guide" but i still stuck in the Handshake part.

This what i did
i connect with TCP to gtalk server, and send this XML
  1. <?xml version="1.0"?>
  2.     <stream:stream  to="gmail.com"
  3.             version="1.0"
  4.             xmlns="jabber:client"
  5.             xmlns:stream="http://etherx.jabber.org/streams">

And the Server send me back the connections options:
  1. <stream:stream from="gmail.com"
  2.         id="5649958EB8EE38BA"
  3.         version="1.0"
  4.         xmlns:stream="http://etherx.jabber.org/streams"
  5.         xmlns="jabber:client">
  6.        
  7. <stream:features>
  8.     <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/>
  9.     </starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  10.         <mechanism>X-GOOGLE-TOKEN</mechanism>
  11.         <mechanism>X-OAUTH2</mechanism>
  12.         </mechanisms>
  13.     </stream:features>

In the start i tried to connect the server with TLS then i send:
  1. <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
And the server send me back that:
  1. <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
But after i get this msg the server kick me off.

Then i tried to connect the server with SASL I send:
  1. <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="X-GOOGLE-TOKEN">Base64{User And Password}</auth>
And the server send me back:
  1. <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><incorrect-encoding/></failure></stream:stream>

I think that i didn't understand how the encoding work, in the book it said
(The Base64-decoded string is  <0>alice<0>password—clearly Alice needs some instruc-tion on best practices for information security.)
what i need to write instead of the <0>. in the internet it say NULL. How to send null in text?

thanks for your help, and sorry for my english
This post was edited 2 times, last on 2012-08-23, 15:34 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
after:
  1. <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>

you have to update your socket to TLS, have you done this?

Then you must reject the existing stream and start again with sending the stream header:

  1. <stream:stream to="gmail.com"
  2.             version="1.0"
  3.             xmlns="jabber:client"
  4.             xmlns:stream="http://etherx.jabber.org/streams">

and wait for the reply of the server an its stream features (options).

Alex
Avatar
elyoni #3
Member since Aug 2012 · 2 posts
Group memberships: Members
Show profile · Link to this post
Thanks for your reply,

i don't know what is mean to update the socket, you can explain more?

What about the SASL Connection?
what i am doing wrong?

Yoni,
This post was edited on 2012-08-23, 15:33 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by elyoni:
i don't know what is mean to update the socket, you can explained more?

Please read here about TLS here:
http://en.wikipedia.org/wiki/Transport_Layer_Security

After you sent:
  1. <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>

and the server replied with:
  1. <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>

you must switch to a secure socket. I think you are not doing this already.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: