[jdev] How to make a gloox based bot, which can login to jabber.org and commercial server like XCP at the same time.

Singh, Brijesh (GDIC) brijesh.singh at hp.com
Fri Jul 7 08:08:17 CDT 2006


 Hi everyone,
 
Good evening....
 
I'm trying to write a small bot application and using gloox-0.7.6.1. At
this point I don't want to change to latest version of gloox-0.8. I'm
facing a small issue with tls support.
 
---------------------------------------------------
void userLogin()
{
 std::string jidstr = usr + "@" + server + "/" + res;
 JID jid(jidstr);
 j = new Client( jid, pwd);
 j->Client::setForceNonSasl( true );
 //j->Client::setForceNonSasl( false );
        j->registerMessageHandler( this );
 j->registerIqHandler( this, XMLNS_ROSTER );
 j->setInitialPriority( 5 );
 j->setAutoPresence( true );
 j->connect();
}
---------------------------------------------------
 
In the following code if i enable  j->Client::setForceNonSasl( false );
then it doesn't work with my local commercial XCP-4.2 server and gives
following error:-
--------------------------------------------------------
resolved symlin3.india.hp.com to: 15.42.228.93:5222
SEND [<?xml version='1.0' ?><stream:stream to='symlin3.india.hp.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>]
RECV [<stream:stream from='symlin3.india.hp.com' id='C6813F4B9A9'
version='1.0' xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>]
RECV [<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/></stream:features>]
SEND [<iq id='uid1' type='get'><query xmlns='jabber:iq:register'/></iq>]
RECV [<iq id='uid1' type='result' xml:lang='en'><query
xmlns='jabber:iq:register'><name/><email/><instructions>Additional
information is needed to
register.</instructions><username/><password/></query></iq>]
resolved symlin3.india.hp.com to: 15.42.228.93:5222
SEND [<?xml version='1.0' ?><stream:stream to='symlin3.india.hp.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>]
RECV [<stream:stream from='symlin3.india.hp.com' id='C6977CC3EF0'
version='1.0' xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>]
RECV [<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/></stream:features>]
the server doesn't support any auth mechanisms we know about
SEND [<iq id='uid2' type='set'><query
xmlns='jabber:iq:register'><username>b2ew2k3</username><password>b2ew2k3
</password><name/><email>brijesh.singh at hp.com</email></query></iq>]
RECV [<iq id='uid2' type='error' xml:lang='en'><query
xmlns='jabber:iq:register'><username>b2ew2k3</username><password>b2ew2k3
</password><name/><email>brijesh.singh at hp.com</email></query><error
code='409' type='cancel'><conflict
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>]
resolved symlin3.india.hp.com to: 15.42.228.93:5222
SEND [<?xml version='1.0' ?><stream:stream to='symlin3.india.hp.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>]
RECV [<stream:stream from='symlin3.india.hp.com' id='C6A50397977'
version='1.0' xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>]
RECV [<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/></stream:features>]
the server doesn't support any auth mechanisms we know about
--------------------------------------------------------------------
 
But at the same time it works with jabber.org server.
 
If i make j->Client::setForceNonSasl( true );  then it works vice versa
i.e. works with commercial server but doesn't works with jabber.org??
--------------------------------------------------------------------
resolved jabber.org to: 208.245.212.98:5222
SEND [<?xml version='1.0' ?><stream:stream to='jabber.org'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>]
RECV [<stream:stream from='jabber.org' id='3553958689' version='1.0'
xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>]
RECV [<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanis
m><mechanism>PLAIN</mechanism></mechanisms><register
xmlns='http://jabber.org/features/iq-register'/></stream:features>]
SEND [<iq id='uid1' type='get'><query xmlns='jabber:iq:register'/></iq>]
RECV [<iq from='jabber.org' id='uid1' type='result'><query
xmlns='jabber:iq:register'><instructions>Choose a username and password
to register with this
server</instructions><username/><password/></query></iq>]
resolved jabber.org to: 208.245.212.98:5222
SEND [<?xml version='1.0' ?><stream:stream to='jabber.org'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>]
RECV [<stream:stream from='jabber.org' id='1437402814' version='1.0'
xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>]
RECV [<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanis
m><mechanism>PLAIN</mechanism></mechanisms><register
xmlns='http://jabber.org/features/iq-register'/></stream:features>]
SEND [<iq id='uid1' to='jabber.org' type='get'><query
xmlns='jabber:iq:auth'><username>b2e11</username></query></iq>]
RECV [<iq from='jabber.org' id='uid1' type='error'><error code='501'
type='cancel'><feature-not-implemented
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>]
SEND [<iq id='uid2' type='set'><query
xmlns='jabber:iq:register'><username>b2e11</username><password>b2e11</pa
ssword></query></iq>]
RECV [<iq from='jabber.org' id='uid2' type='error'><query
xmlns='jabber:iq:register'><username>b2e11</username><password>b2e11</pa
ssword></query><error code='409' type='cancel'><conflict
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>]
resolved jabber.org to: 208.245.212.98:5222
SEND [<?xml version='1.0' ?><stream:stream to='jabber.org'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>]
RECV [<stream:stream from='jabber.org' id='1504035913' version='1.0'
xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>]
RECV [<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanis
m><mechanism>PLAIN</mechanism></mechanisms><register
xmlns='http://jabber.org/features/iq-register'/></stream:features>]
SEND [<iq id='uid1' to='jabber.org' type='get'><query
xmlns='jabber:iq:auth'><username>b2e11</username></query></iq>]
RECV [<iq from='jabber.org' id='uid1' type='error'><error code='501'
type='cancel'><feature-not-implemented
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>]
------------------------------------------------------------------------
-----
 
 
Can you please provide me any clue to solve this issue?
 
Thanks and best regards
Brijesh 


-----Original Message-----
From: jdev-bounces at jabber.org [mailto:jdev-bounces at jabber.org] On Behalf
Of jdev-request at jabber.org
Sent: Sunday, April 09, 2006 10:30 PM
To: jdev at jabber.org
Subject: jdev Digest, Vol 27, Issue 7

Send jdev mailing list submissions to
	jdev at jabber.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.jabber.org/mailman/listinfo/jdev
or, via email, send a message with subject or body 'help' to
	jdev-request at jabber.org

You can reach the person managing the list at
	jdev-owner at jabber.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of jdev digest..."


Today's Topics:

   1. [ANN] gloox 0.8 (Jakob Schroeter)


----------------------------------------------------------------------

Message: 1
Date: Sun, 9 Apr 2006 00:13:27 +0200
From: Jakob Schroeter <js at camaya.net>
Subject: [jdev] [ANN] gloox 0.8
To: Jabber software development list <jdev at jabber.org>
Message-ID: <200604090013.54547.js at camaya.net>
Content-Type: text/plain; charset="us-ascii"

I'm pleased to announce the release of gloox 0.8.

New features since 0.7.6:
- Message Events (JEP-0022)
- Chate State Notifications (JEP-0085)
- vcard-temp (JEP-0054)
- In-Band Bytestreams (JEP-0047)
and more improvements and bugfixes.

gloox is a spec-compliant, feature-rich and flexible XMPP library
(basically a client without GUI) written in C++, making it easy to
integrate Jabber/XMPP functionality into existing applications or
writing clients from scratch.

http://camaya.net/gloox

cheers,
Jakob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :
https://www.jabber.org/jdev/attachments/20060409/9993fa9e/atta
chment-0001.pgp

------------------------------

_______________________________________________
jdev mailing list
jdev at jabber.org
http://mail.jabber.org/mailman/listinfo/jdev


End of jdev Digest, Vol 27, Issue 7
***********************************



More information about the JDev mailing list