Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
JFulford #1
Member since Oct 2015 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Getting error when opening client.
  1. static XmppClient client;
  2.         static void Main(string[] args)
  3.         {
  4.             string lic = @"sometext";
  5.             Matrix.License.LicenseManager.SetLicense(lic);
  6.             client = new XmppClient();
  7.             ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
  8.  
  9.  
  10.             client.Username = "334";
  11.             client.Hostname = "voip";
  12.             client.Password = "9999";
  13.             client.Resource = "pbx";
  14.             client.XmppDomain = "voip";
  15.             client.OnError += client_OnError;
  16.             client.OnBeforeSasl += client_OnBeforeSasl;
  17.             client.Open();
  18.             Console.ReadLine();
  19.         }


OnError is hit and notifies me of a null reference exception.

StackTrace    "   at Matrix.Xmpp.Sasl.Processor.Digest.Step2.SupportsAuth(String qop)   at Matrix.Xmpp.Sasl.Processor.Digest.Step2..ctor(Step1 step1, SaslProcessor proc)   at Matrix.Xmpp.Sasl.Processor.Digest.DigestMd5Processor.Parse(Challenge ch)   at Matrix.SaslHandler.XmppStreamParser_OnStreamElement(Object sender, StanzaEventArgs e)   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)  at Matrix.Xml.XmppStreamParser.DoRaiseOnStreamElement(XmppXElement el)"    string

Any idea what this is?
This post was edited on 2015-10-07, 21:58 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It looks like there is a compatibility issue between your server and MatriX regarding the SASL DIGEST_MD5 authentication.
We have not seen such an error in many years. To see why it happens and which implementation is wrong we would need to debug against your server and look at the SASL messages.

Alex
Avatar
Alex #3
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
your complete Xml log will also help, from there we can get and parse the SASL message.
Avatar
JFulford #4
Member since Oct 2015 · 3 posts
Group memberships: Members
Show profile · Link to this post
Would you like me to log it with WireShark or is there a simple way I can have the Matrix library log the XML messages?
Avatar
Alex #5
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
See here:
http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…
Avatar
JFulford #6
Member since Oct 2015 · 3 posts
Group memberships: Members
Show profile · Link to this post
  1. OnSend >>>
  2. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="voip" version="1.0" >
  3.  
  4. OnReceive >>>
  5. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="voip" version="1.0" id="vm3r2pk03kaavvq7r0cnx1mdpndwgiec4h477p7a" xmlns:ack="http://www.xmpp.org/extensions/xep-0198.html#ns" >
  6.  
  7. OnReceive >>>
  8. <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  9.  <address xmlns="http://affinix.com/jabber/address">10.0.16.145</address>
  10.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  11.     <mechanism>PLAIN</mechanism>
  12.     <mechanism>DIGEST-MD5</mechanism>
  13.  </mechanisms>
  14.  <auth xmlns="http://jabber.org/features/iq-auth" />
  15. </stream:features>
  16.  
  17. OnSend >>>
  18. <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
  19.  
  20. OnReceive >>>
  21. <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09InZvaXAudGF4ZGVmZW5zZW5ldHdvcmsuY29tIiwgbm9uY2U9InZoRkYvc0lYaXFMRXNvRnlKOGNCUXc9PSIsIHFvcD0iYXV0aCIsIGNoYXJzZXQ9dXRmLTgsIGFsZ29yaXRobT1tZDUtc2Vzcw==</challenge>

OnError >>>
System.NullReferenceException: Object reference not set to an instance of an object.
   at Matrix.Xmpp.Sasl.Processor.Digest.Step2.SupportsAuth(String qop)
   at Matrix.Xmpp.Sasl.Processor.Digest.Step2..ctor(Step1 step1, SaslProcessor proc)
   at Matrix.Xmpp.Sasl.Processor.Digest.DigestMd5Processor.Parse(Challenge ch)
   at Matrix.SaslHandler.XmppStreamParser_OnStreamElement(Object sender, StanzaEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Matrix.Xml.XmppStreamParser.DoRaiseOnStreamElement(XmppXElement el)
This post was edited on 2015-10-08, 14:28 by Alex.
Avatar
Alex #7
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The decoded messages is the following:

realm=\"yourdomain\", nonce=\"vhFF/sIXiqLEsoFyJ8cBQw==\", qop=\"auth\", charset=utf-8, algorithm=md5-sess

the server puts spaces between all the pairs. I am not sure if this allowed according to the specs.

Anyway, we trim those out now and it should work fine then.

  • Which MatriX version are you using? Then we will upload new NuGet packages for you.
  • Just for our records, which server software is producing such a message?

Thanks,
Alex
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
version 2.0.0.8 for Windows Desktop is here on NuGet:
https://www.nuget.org/profiles/agsoftware

Can you try it?

Thanks,
Alex
Avatar
Alex #9
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
did this build fix your problem?
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.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS