Hi,
I've installed ejabberd 1.1.3 server on Windows 2003. It works fine when I use the exodus or any other client but in our project we have our own client and when I try to connect to ejabberd server through this client i got the following error "SASL failure: ". I'm putting down the steps which gets executed while trying to connect the ejabberd server :
1.
public DFJabberClient(Babble form)
{
try
{
//initialize the Jabber object
jabber.client.JabberClient jc = new jabber.client.JabberClient();
rm = new RosterManager();
//you must use the RosterManager or you can't use
//the events to build the real roster hashmap
rm.OnRosterBegin +=new bedrock.ObjectHandler(rm_OnRosterBegin);
rm.OnRosterEnd +=new bedrock.ObjectHandler(rm_OnRosterEnd);
rm.OnRosterItem +=new RosterItemHandler(rm_OnRosterItem);
pm = new PresenceManager();
//this.jc.LocalCertificate = null;
jc.Password = null;
jc.Server = null;
jc.Resource = "";
jc.PlaintextAuth = true;
jc.User = null;
jc.OnAuthError +=new IQHandler(jc_OnAuthError);
jc.OnAuthenticate +=new bedrock.ObjectHandler(jc_OnAuthenticate);
jc.OnReadText +=new bedrock.TextHandler(jc_OnReadText);
jc.OnWriteText +=new bedrock.TextHandler(jc_OnWriteText);
jc.OnError +=new bedrock.ExceptionHandler(jc_OnError);
jc.OnMessage +=new MessageHandler(jc_OnMessage);
jc.OnLoginRequired +=new bedrock.ObjectHandler(jc_OnLoginRequired);
jc.AutoReconnect = -1;//3f; Do not auto re-connect...never stops pinging the server
// on some errors.
jc.AutoRoster = true; //gets the roster without calling jc.GetRoster() method.
jc.AutoPresence = true;
jc.OnPresence +=new PresenceHandler(jc_OnPresence);
//jc.OnConnect +=new bedrock.net.AsyncSocketHandler(jc_OnConnect);
jc.OnDisconnect += new bedrock.ObjectHandler(jc_OnDisconnect);
rm.Client = jc;
pm.Client = jc;
}
catch (Exception ex)
{
s_log.Error(ex.StackTrace);
}
}
2.
public void connect(string sUserId, string sPswd, string sServer)
{
try
{
jc.AutoLogin = false;
jc.User = sUserId;
jc.Password = sPswd;
jc.Port = 5222;
jc.SSL = false;
jc.RequiresSASL = true;
jc.Server = sServer;
jc.NetworkHost = sServer;
jc.Connect();
jc.Login();
}
catch (Exception ex)
{
s_log.Error(ex.StackTrace);
//this._frmBabble.setMessage(ex.Source + ": " + ex.Message,"Error",false);
}
}
No error comes and it connects fine and I've also seen the log file and it says accepted connection but then the following event handler gets called
3. private void jc_OnError(object sender, Exception excep)
{
}
and the exception is SASL exception.
Please help to solve the problem and if you need some more info please tell me