erichocean / libjingle

Automatically exported from code.google.com/p/libjingle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use another server to login?

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
using call example with another server (specified through --s flag)

What is the expected output? What do you see instead?
the app cannot login using jabber.org

What version of the product are you using? On what operating system?
tested on 0.5.6 and 0.5.8. Ubuntu 10.04

Please provide any additional information below.
The log is bellow:

./call --s=jabber.org --voiceinput=voice.rtpdump --videoinput=video.rtpdump 
--voiceoutput=voiceout.rtpdump --videooutput=videoout.rtpdump --a --d
JID: #TEXT REMOVED#@jabber.org        
Password: 
Logging in to jabber.org as #TEXT REMOVED#@jabber.org
Available commands:

  roster              Prints the online friends from your roster.
  friend user         Request to add a user to your roster.
  call [jid] [bw]     Initiates a call to the user[/room] with the
                      given JID and with optional bandwidth.
  vcall [jid] [bw]    Initiates a video call to the user[/room] with
                      the given JID and with optional bandwidth.
  voicemail [jid]     Leave a voicemail for the user with the given JID.
  join [room_jid]     Joins a multi-user-chat with room JID.
  ljoin [room_name]   Joins a MUC by looking up JID from room name.
  invite user [room]  Invites a friend to a multi-user-chat.
  leave [room]        Leaves a multi-user-chat.
  getdevs             Prints the available media devices.
  quit                Quits the application.

Resolving addr in PhysicalSocket::Connect
OpenSSLAdapter::OnConnectEvent
SEND >>>>>>>>>>>>>>>> : Wed Jul 27 17:10:26 2011
   <stream:stream to="jabber.org" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
logging in...
RECV <<<<<<<<<<<<<<<< : Wed Jul 27 17:10:26 2011
   <?xml version='1.0'?>
     <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='jabber.org' id='ee61b12c8aa012e1' version='1.0'>
       <stream:features>
         <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
         <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
           <mechanism>
             CRAM-MD5
           </mechanism>
           <mechanism>
             LOGIN
           </mechanism>
           <mechanism>
             PLAIN
           </mechanism>
           <mechanism>
             DIGEST-MD5
           </mechanism>
           <mechanism>
             SCRAM-SHA-1
           </mechanism>
         </mechanisms>
         <compression xmlns='http://jabber.org/features/compress'>
           <method>
             zlib
           </method>
         </compression>
         <ver xmlns='urn:xmpp:features:rosterver'>
           <optional/>
         </ver>
       </stream:features>
SEND >>>>>>>>>>>>>>>> : Wed Jul 27 17:10:26 2011


   <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
RECV <<<<<<<<<<<<<<<< : Wed Jul 27 17:10:26 2011
   <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
BeginSSL: jabber.org
ContinueSSL
 -- error want read
SEND >>>>>>>>>>>>>>>> : Wed Jul 27 17:10:27 2011
   <stream:stream to="jabber.org" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
ContinueSSL
 -- error want read
ContinueSSL
 -- error want read
ContinueSSL
 -- error want read
ContinueSSL
 -- error want read
ContinueSSL
 -- error -1
Warning(openssladapter.cc:402): OpenSSLAdapter::Error(ContinueSSL, -1)


Original issue reported on code.google.com by diego.cd...@gmail.com on 27 Jul 2011 at 8:26

I have the same issue with my own ejabberd 2.18 server.

Original comment by steel...@gmail.com on 10 Aug 2011 at 3:27

Did anyone resolve this issue?

Original comment by triaphoo on 14 Sep 2011 at 1:44

Try the followings:
1. Use plain authentication and disable tls.
2. Fix the bug which might lead to tls cannot be disabled: 
http://code.google.com/p/libjingle/issues/detail?id=72&q=server

Original comment by wangqin...@gmail.com on 19 Sep 2011 at 10:03

Dose anyone know how to receive presence info for other nodes after logged in? 
I could get presence stanza of the client itself but could not receive any 
stanza about other clients. My server is ejabbered 2.1.8 as well.

Original comment by wangqin...@gmail.com on 19 Sep 2011 at 10:08

Hi wanggin...@gmail.com, thanks for answering. The call app flag --plainserver 
does exactly what you said (use plain authentication and disable tls) but I 
still could not connect. Have you already connected in another server using the 
call app, for instance jabber.org? If not, could you try to connect using a 
jabber.org account?
About what you asked, you can request your roster to the server using something 
like this:

XmppReturnStatus PresenceOutTask::SendRequestRoster()
{
    if (GetState() != STATE_INIT && GetState() != STATE_START)
        return XMPP_RETURN_BADSTATE;

    XmlElement* iq = new XmlElement(QN_IQ);
    iq->AddAttr(QN_TYPE, STR_GET);
    XmlElement* query = new XmlElement(QN_ROSTER_QUERY);
    iq->AddElement(query);
    QueueStanza(iq);

    return XMPP_RETURN_OK;
}

I call this in the end of CallClient::InitPresence. This works for jabber.org. 
If this doesn't work for your server, let me know and show me the debug 
messages. I hope it helps.

Original comment by diego.cd...@gmail.com on 19 Sep 2011 at 5:46

Hi Diego,

Thanks for your reply. 

For your question, have you fixed that bug? It is still there in libjingle 
0.5.8 release. I wasn't work on call app, instead, I am building a simple app 
for data transmission with TunnelSessionClient. But the login process should be 
the same. I can connect to my local ejabberd server, after using plan auth and 
fixing the bug as I have mentioned. 

For my question, I mean I could just got my own status update from xmpp server. 
Is that because each of the client need to add to a roster group or 
something(like add as friends in gtalk) for receiving status update from 
server? But anyway, the online status is not important in my app, because I 
just need to transfer data. And I can just send the data out whether sender 
knows receiver is online or not, and hope for the best. Do you have any 
suggestion, thanks!

Original comment by wangqin...@gmail.com on 20 Sep 2011 at 10:22

Hi wanggin...@gmail.com, as your issue (72) is very old I tought it was already 
solved. Now, I aplied the changes and it worked. Thanks a lot. But, does it 
mean that libjingle has an error? It's weird because the call app has a flag 
--s to indicate the server which you want to log in but it does not work. After 
modified the xmpplogintask.cc as you suggested and using --plainserver it 
worked.
About what you asked I think I did not understand your doubt. If you want to 
invite users to your roster or accept invites from other users you have to 
implement some features in presencepushtask.cc and presenceouttask.cc according 
to the pub-sub model. Currently libjingle does not support the pub-sub model. 
For instance, I implemented a way to auto-accept invites from other users. 
Thanks again.

Original comment by diego.cd...@gmail.com on 20 Sep 2011 at 4:36

Thanks Diego, I just want to know if two clients must add each other into a 
roster group before they can receive message from the other, or any two clients 
on the network can exchange xmpp messages freely without know roster group? The 
roster things seems no need in my app. Anyway, I will read xmpp core protocol 
to find if my guess is correct, thanks!

Original comment by wangqin...@gmail.com on 21 Sep 2011 at 3:20

I'm not sure but I believe they need to be in each other roster to exchange 
messages.
Now about the issue itself, I would like to ask the libjingle developers to 
correct this bug, otherwise the --s flag of the call app is useless.

Original comment by diego.cd...@gmail.com on 21 Sep 2011 at 4:20

The solution proposed by wanggin...@gmail.com works but disables TLS. Another 
way, that I discovered today, is to undo the changes made on xmppsocket.cc on 
rev65 (when libjingle was updated to version 0.5.6):
http://code.google.com/p/libjingle/source/diff?spec=svn95&r=65&format=side&path=
/trunk/talk/examples/login/xmppsocket.cc&old_path=/trunk/talk/examples/login/xmp
psocket.cc&old=30
In this commit, they removed two lines that were allowing certificates of 
unknown Certificate Authorities.
BTW, I would like to know why this was removed? I mean, I know that unknown CA 
should not be allowed but why this was allowed before this revision? Shouldn't 
it be an option for the user (e.g. new call example flag)?

Original comment by diego.cd...@gmail.com on 17 Nov 2011 at 3:55

It is also possible to login on any server using the flags I explained on  
issue 72 , comment #9, but it disables TLS.

Original comment by diego.cd...@gmail.com on 15 Dec 2011 at 12:35

Original comment by juberti@google.com on 1 Jun 2013 at 4:16

  • Changed state: Invalid