Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
alexey_gusev #1
Subject: Matrix Mobile 1.3.1.1
I have been using v1.2.1.1 for some time - and it worked more or less reliably, but few days ago I've downloaded 1.3.1.1 and that suddenly stopped working!

What I saw is that regardless of StartTls or KeepAliveInterval values it always threw SocketException and also NullReferenceException in Matrix.dll and then finally arrived to OnError() handler.

Is this a known issue or I'm missing something simple?

BR,
Alex
Avatar
Alex #2
Quote by alexey_gusev:
Is this a known issue or I'm missing something simple?

hm, no, can you post a complete stacktrace?

Alex
Avatar
alexey_gusev #3
Hi, Alex,

I've double checked and cleaned all I only could think of, and now it's not throwing SocketException anymore, but the following (see below). I should probably mention I run it on WinCE 5.0. It happens with and without StartTls = true.

Xmpp Debug output:
DEBUG: SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="jabber.org" version="1.0" >
DEBUG: RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="jabber.org" id="54a01d9b6211e1b9" version="1.0" >
DEBUG: RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <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>
DEBUG: SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
DEBUG: RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />

The exception (I checked CRL Exceptions and Managed Debugging Assistant in Debug->Exceptions):

"Internal TLS error, this could be an attack"
   at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.FailWithError(Int16 alertLevel, Int16 alertDescription)
   at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.processHandshake()
   at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.ProcessData(Int16 protocol, Byte[] buf, Int32 offset, Int32 len)
   at Org.BouncyCastle.Crypto.Tls.RecordStream.ReadData()
   at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.Connect(ICertificateVerifyer verifyer, Certificate clientCertificate, AsymmetricKeyParameter clientPrivateKey)
   at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.Connect(ICertificateVerifyer verifyer)
   at Matrix.Net.ClientSocket.�()
   at Matrix.Net.ClientSocket.StartTls()
   at Matrix.Xmpp.Client.XmppClient.�()
   at Matrix.Xmpp.Client.XmppClient.XmppStreamParser_OnStreamElement(Object sender, StanzaEventArgs e)
   at Matrix.Xml.XmppStreamParser.�(XmppXElement �)
   at Matrix.Xml.XmppStreamParser.�(Byte[] �, Int32 �, �? �, �? �)
   at Matrix.Xml.XmppStreamParser.Write(Byte[] buf, Int32 offset, Int32 length)
   at Matrix.XmppStream.Matrix.XmppStream??�(Object �, SocketEventArgs �)
   at Matrix.Net.BaseSocket.FireOnReceive(Byte[] data, Int32 offset, Int32 length)
   at Matrix.Net.ClientSocket.�(IAsyncResult �)
   at System.Net.LazyAsyncResult.InvokeCallback(Boolean asyncCompletion)
   at System.Net.Sockets.Socket.WorkerThread.doWork()
   at System.Net.Sockets.Socket.WorkerThread.doWorkI(Object o)
   at System.Threading.ThreadPool.WorkItem.doWork(Object o)
   at System.Threading.Timer.ring()

"System.Net.Sockets.NetworkStream"
   at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at Matrix.Net.ClientSocket.�()
   at Matrix.Net.ClientSocket.�(IAsyncResult �)
   at System.Net.LazyAsyncResult.InvokeCallback(Boolean asyncCompletion)
   at System.Net.Sockets.Socket.WorkerThread.doWork()
   at System.Net.Sockets.Socket.WorkerThread.doWorkI(Object o)
   at System.Threading.ThreadPool.WorkItem.doWork(Object o)
   at System.Threading.Timer.ring()
Avatar
Alex #4
In this log you have StartTls = true, MatriX negotiates TLS and there seems to be a TLS problem. Try without Tls.

BTW i uploaded a new Mobile version some minutes ago which I have successfully tested on my jabber.org account with and without Tls. But I tested on on WM6 pro.

Alex
Avatar
alexey_gusev #5
Hello Alex,

sorry for the delay with the answer - I was dragged to something else as usual and couldn't check new versions.

From what I see now, I've tried both 1.3.1.0 versions available as 'stable build' and 'development build'. In both cases I see that there is some IOException in Crypto.dll and then ObjectDisposed exception. Hence it never manages to connect.

v1.2.1.0 works though :) On few occasions I've got NullReferenceException in OnError() handler (ie it was called with such exception as a parameter), but I cannot put my finger on something specific - it was connected for some time and then disconnected and never reconnected back.

I'm using some custom device with WinCE 5.0, so I wouldn't be surprised if it lacks some dlls/API, but it would be really nice if 1.3.1.0 can work on it.

BR,
Alex
Avatar
Alex #6
1.2.1.0 was without TLS support using the crypto library. It was using native TLS which was causing problems on reconnect.
Can you please try without TLS (StartTls = false)?

Are there emulator images for VS2008 for WinCE 5.0?

Alex
Avatar
alexey_gusev #7
There are no emulators for WinCE and VS2008, Microsoft has long abandoned it :(

Re. new matrix.dll version. I have tried with StartTls = false;

I drives me crazy :) because I see in the log that regardless of what I set in the code, it logs the following:


[10/27/2009 12:45:11 PM] DEBUG: SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="jabber.org" version="1.0" >
[10/27/2009 12:45:12 PM] DEBUG: RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="jabber.org" id="ac6ed09b59c7d9ef" version="1.0" >
[10/27/2009 12:45:12 PM] DEBUG: RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <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>
[10/27/2009 12:45:12 PM] DEBUG: SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
[10/27/2009 12:45:13 PM] DEBUG: RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />

General pattern is that it arrives to OnCLose() first, then to OnError() with something like that:

[10/27/2009 3:51:44 PM] DEBUG: xmppClient.OnClose()
[10/27/2009 3:51:44 PM] DEBUG: CreateReconnectTimer: reconnectAttempt=0
[10/27/2009 3:51:44 PM] DEBUG: xmppClient.OnError(): System.Net.Sockets.NetworkStream    at System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at Matrix.Net.ClientSocket.Send(Byte[] bData)
   at Matrix.XmppStream.?(String ?)
   at Matrix.XmppStream.?(String ?)
   at Matrix.XmppStream.?(Object ?)
   at System.Threading.Timer.ring()

I'll happily try whatever you think is worth :)
This post was edited on 2010-10-27, 21:32 by alexey_gusev.
Avatar
Alex #8
sorry but I cannot cause your problem. When StartTls is false then it use no Tls here.
I uploaded a new build to:
http://www.ag-software.net/downloads.html
Please make sure that you use this build and StartTls is false.

Alex
Avatar
alexey_gusev #9
whoo hoo, it connects :)

found finally a piece of code that set StartTls to true (a leftover from earlier tests), so now it works without Tls. Phew!

Thanks a lot for your patience and help.
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.)