Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Zapbbx #1
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: unknown host
I am trying to connect to a customers sandbox server.  I can easily do this with Gajim or Adium clients.  I have connected both to the sandbox and sent messages.  I can't seem to get Matrix to connect though.

hypothetically my settings are:

user: user1\40website.net.1fe7d4e59c9c63d9552931999c55c9f1401ea599@api.clientdomain.com
pass: xxxx
server: sb1.app.tstserver.com

While this connects with an IM client, notice the @api.clientdomain.com is different from sb1.app.tstserver.com.

I can't seem to set this right using Matrix... With this code:

  1. xmppClient.SetXmppDomain(settings.domain);
  2. xmppClient.Username = settings.user;
  3.  
  4. xmppClient.Password = settings.pwd;
  5. xmppClient.Hostname = settings.host;
  6. xmppClient.Transport = Matrix.Net.Transport.Socket;
  7.  
  8. // set settings
  9. _login.User = settings.loginUser;
  10. _login.Server = settings.loginServer;
  11. _login.Password = settings.loginPass;
  12.  
  13. xmppClient.Status = "ready for chat";
  14. xmppClient.Show = Matrix.Xmpp.Show.chat;
  15.  
  16. xmppClient.StartTls = false;
  17. xmppClient.Open();

I have tried every combination of:
user: user1\40website.net.1fe7d4e59c9c63d9552931999c55c9f1401ea599@api.clientdomain.com
pass: xxxx
server: sb1.app.tstserver.com

that I can think of..  they all result in:

  1. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="sb1.app.tstserver.com" version="1.0" >
  2. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3268448353" from="api.clientdomain.com" xml:lang="en" >
  3. RECV: <stream:error xmlns:stream="http://etherx.jabber.org/streams">
  4.  <host-unknown xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
  5. </stream:error>
  6. SEND: </stream:stream>
  7. RECV: </stream:stream>

Any ideas?
This post was edited on 2014-01-23, 20:12 by Alex.
Avatar
Zapbbx #2
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: I'm using connection code l this
  1. public class ConnSettings
  2.     {
  3.         public string user { get; set; }
  4.         public string domain { get; set; }
  5.         public string pwd { get; set; }
  6.         public string host { get; set; }
  7.         public string loginUser { get; set; }
  8.         public string loginServer { get; set; }
  9.         public string loginPass { get; set; }
  10.     }
  11.  
  12. Then in a method calls:
  13.  var settings = new ConnSettings()
  14.             {
  15.                 user = @"user1\40website.net.1fe7d4e59c9c63d9552931999c55c9f1401ea599@api.clientdomain.com",
  16.                 loginUser = @"user1\40website.net.1fe7d4e59c9c63d9552931999c55c9f1401ea599@api.clientdomain.com",
  17.                 domain = "sb1.app.tstserver.com",
  18.                 host = "sb1.app.tstserver.com",
  19.                 loginServer = "api.clientdomain.com",
  20.                 loginPass = "",
  21.                 pwd = ""
  22.             };
  23.  
  24.             ConnectFromSettings(settings);
  25.  
  26.  private void ConnectFromSettings(ConnSettings settings)
  27.         {
  28.             xmppClient.SetXmppDomain(settings.domain);
  29.             xmppClient.Username = settings.user;
  30.            
  31.             xmppClient.Password = settings.pwd;
  32.             xmppClient.Hostname = settings.host;
  33.             xmppClient.Transport = Matrix.Net.Transport.Socket;
  34.  
  35.             // set settings
  36.             _login.User = settings.loginUser;
  37.             _login.Server = settings.loginServer;
  38.             _login.Password = settings.loginPass;
  39.  
  40.             xmppClient.Status = "ready for chat";
  41.             xmppClient.Show = Matrix.Xmpp.Show.chat;
  42.  
  43.             xmppClient.StartTls = false;
  44.             xmppClient.Open();
  45.         }
This post was edited on 2014-01-23, 20:12 by Alex.
Avatar
Alex #3
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Your XMPP domain is wrong which you can see here at the beginning of the stream:

SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="sb1.app.tstserver.com" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3268448353" from="api.clientdomain.com" xml:lang="en" >

The Xmpp domain must be api.clientdomain.com
Avatar
Zapbbx #4
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
OK, now I get:

  1. xmppClient.SetXmppDomain("api.clientdomain.com");
  2. xmppClient.Username = "user1\40website.net.1fe7d4e59c9c63d9552931999c55c9f1401ea599@api.clientdomain.com";
  3.  
  4. xmppClient.Password = "Password";
  5. xmppClient.Hostname = "sb1.app.tstserver.com";
  6. xmppClient.Transport = Matrix.Net.Transport.Socket;
  7.  
  8. // set settings
  9. _login.User = "user1\40website.net.1fe7d4e59c9c63d9552931999c55c9f1401ea599@api.clientdomain.com";
  10. _login.Server = "sb1.app.tstserver.com";
  11. _login.Password = "Password";
  12.  
  13. xmppClient.Status = "ready for chat";
  14. xmppClient.Show = Matrix.Xmpp.Show.chat;
  15.  
  16. xmppClient.StartTls = false;
  17. xmppClient.Open();

  1. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="api.clientdomain.com" version="1.0" >
  2. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3729684385" from="api.clientdomain.com" version="1.0" xml:lang="en" >
  3. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  4.  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  5.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  6.     <mechanism>PLAIN</mechanism>
  7.  </mechanisms>
  8.  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="8P/XuMtKq0lNk50DLBC8v+TXoAU=" />
  9.  <register xmlns="http://jabber.org/features/iq-register" />
  10. </stream:features>
  11. SEND: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
  12. RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  13.  <not-authorized />
  14. </failure>
  15. SEND: </stream:stream>
  16. RECV: </stream:stream>
This post was edited 2 times, last on 2014-01-23, 21:07 by Alex.
Avatar
Alex #5
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  1. <not-authorized />

means that your credentials are wrong. Either username, password or both of them.

Alex
Avatar
Alex #6
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
user normally without the @api.clientdomain.com
Avatar
Zapbbx #7
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
But this IS required using the IM client.  This is why this sucks, there is no clear answer as to what the settings should be...

All that matters really is how Matrix presents the JID to the XMPP server.  I can't compare how Matrix does it with how the IM client does it, its too low level and in a socket.  If I take the @api.clientDomain.com off I get:

  1. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="api.clientdomain.com" version="1.0" >
  2. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="1978932045" from="api.clientdomain.com" version="1.0" xml:lang="en" >
  3. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  4.  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  5.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  6.     <mechanism>PLAIN</mechanism>
  7.  </mechanisms>
  8.  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="8P/XuMtKq0lNk50DLBC8v+TXoAU=" />
  9.  <register xmlns="http://jabber.org/features/iq-register" />
  10. </stream:features>
  11. SEND: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
  12. RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  13.  <not-authorized />
  14. </failure>
  15. SEND: </stream:stream>
  16. RECV: </stream:stream>

So, its not that my credentials are wrong ( I can connect just fine with IM Client)  but rather they aren't being output by Matrix the same way as the IM client.
This post was edited on 2014-01-23, 21:11 by Alex.
Avatar
Alex #8
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Zapbbx:
So, its not that my credentials are wrong ( I can connect just fine with IM Client)  but rather they aren't being output by Matrix the same way as the IM client.

Send us screenshots of the other client which connects fine ans we will provide you the correct settings for MatriX.
A Xml log of this client will help as well.

Alex
Avatar
Zapbbx #9
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
sent you logs and screenshots. thanks
Avatar
Alex #10
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
problem was solved

  • username was without the @api.clientdomain.com at the end
  • the server host must be set manual, because  api.clientdomain.com poits to a wrong xmpp server. To do that the following code is required

  1. xmppClient.ResolveSrvRecords = false;
  2. xmppClient.XmppDomain = "correct hostname or ip";
Avatar
Zapbbx #11
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
Thanks again for your help Alex.
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