RemoteCertificate and SSL results in error

I am connecting to the eJabberd xmpp server.
I have used the Spark client
and
A home grown client build using the Jabber-Net library.
For both of these clients - when I connect using SSL an error is generated.

In my code the error occurs at:
return m_sslStream.RemoteCertificate;

Note: m_sslStream is an object of type System.Net.Security.SslStream
Note: this exact same code( and the spark client) both connect without error to the openfire xmpp server.

The error that is thrown is of type System.IO.IOException
The message is "The handshake failed due to an unexpected packet format."
The stack trace is:
at System.Net.Security.SslState.CheckThrow(Boolean authSucessCheck)
at System.Net.Security.SslStream.get_RemoteCertificate()
at bedrock.net.AsyncSocket.get_RemoteCertificate()
in C:\\Documents and Settings\\c.hanks\\My Documents\\Visual Studio 2005\\Projects\\N2k IM-Chat\\JabberNet-2.1.0.710\\bedrock\\net\\AsyncSocket.cs:line 231
at jabber.connection.SocketStanzaStream.bedrock.net.ISocketEventListener.OnConnect(BaseSocket sock)
in C:\\Documents and Settings\\c.hanks\\My Documents\\Visual Studio 2005\\Projects\\N2k IM-Chat\\JabberNet-2.1.0.710\\jabber\\connection\\SocketStanzaStream.cs:line 393
at bedrock.net.AsyncSocket.ExecuteConnect(IAsyncResult ar)
in C:\\Documents and Settings\\c.hanks\\My Documents\\Visual Studio 2005\\Projects\\N2k IM-Chat\\JabberNet-2.1.0.710\\bedrock\\net\\AsyncSocket.cs:line 821
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)\r\n at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)\r\n at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)\r\n at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)"

Works for me

I can connect with several Jabber clients like Psi, Gajim, Tkabber, Pidgin and Jabbim.

hi,mfoss Can provide me

hi,mfoss

Can provide me sample code to connect with Jabber client.its urgent .

Getting following following error:
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
at bedrock.net.AsyncSocket.StartTLS()

if setting SSL true then following error:
"System.Exception: Unexpected exception ---> stringprep.steps.ProhibitedCharacterException: Step XMPP Node prohibits string (character U+0040).\r\n at stringprep.steps.ProhibitStep.Prepare(StringBuilder result)\r\n at stringprep.Profile.Prepare(StringBuilder result)\r\n at stringprep.Profile.Prepare(String input)\r\n at jabber.JID..ctor(String user, String server, String resource)\r\n at jabber.client.JabberClient.Login()\r\n at jabber.client.JabberClient.JabberClient_OnSASLStart(Object sender, SASLProcessor proc)\r\n at jabber.connection.XmppStream.OnDocumentStart(Object sender, XmlElement elem)\r\n at jabber.connection.XmppStream.jabber.connection.IStanzaEventListener.DocumentStarted(XmlElement elem)\r\n at jabber.connection.SocketStanzaStream.m_elements_OnDocumentStart(Object sender, XmlElement rp)\r\n at jabber.protocol.ElementStream.FireOnDocumentStart(XmlElement stream)\r\n at jabber.protocol.AsynchElementStream.StartTag(Byte[] buf, Int32 offset, ContentToken ct, TOK tok)\r\n at j
abber.protocol.AsynchElementStream.Push(Byte[] buf, Int32 offset, Int32 length)\r\n --- End of inner exception stack trace ---\r\n at jabber.protocol.AsynchElementStream.Push(Byte[] buf, Int32 offset, Int32 length)\r\n at jabber.connection.SocketStanzaStream.bedrock.net.ISocketEventListener.OnRead(BaseSocket sock, Byte[] buf, Int32 offset, Int32 length)"

Syndicate content