Open lovetox opened 8 years ago
The DNS library was updated. Are you testing from Nuget or the main branch? Can you give it a try with this branch https://github.com/pgstath/Sharp.Xmpp/commit/24445c75426bcd7626558099a35a2a1c367c369d ?
this didnt change anything
just try it yourself with these connection strings
string hostname = "jabber.at";
string username = "asd";
string password = "asd";
another server that is not working
jabber.ccc.de
i found the error
if you connect with a connect string hostname = jabber.at
you get this
_xmpp-client._tcp.jabber.at. 66173 IN SRV 600 0 443 xmpp.jabber.at.
|--- Name _xmpp-client._tcp.jabber.at.
|--- Port: 443
|--- Priority600
|--- Type Srv
|--- Target: xmpp.jabber.at.
_xmpp-client._tcp.jabber.at. 66173 IN SRV 300 0 5222 xmpp.jabber.at.
|--- Name _xmpp-client._tcp.jabber.at.
|--- Port: 5222
|--- Priority300
|--- Type Srv
|--- Target: xmpp.jabber.at.
now the code sets xmpp.jabber.at
as the new hostname.
and sends an xml stanza with "to:xmpp.jabber.at" element.
but thats a hostname thats not known to jabber.at cause it allows only for jabber.at
this happens in the new XmppClient()
logic
if you edit the variable before you call the Connect()
function back to jabber.at everything works
a dirty fix for this problem is to overwrite the hostname after calling new XmppClient()
client = new XmppClient(hostname, username, password, 5222);
client.Hostname = hostname;
client.Connect()
i dont know much about DNS and stuff, but if i do this like that everything works, which brings me to the question why this DNS lookup is even made in the firstplace, if you dont need it.
now the code sets xmpp.jabber.at as the new hostname. and sends an xml stanza with "to:xmpp.jabber.at" element. but thats a hostname thats not known to jabber.at cause it allows only for jabber.at
Solid debugging thanks for this. I did not had the chance to test it myself but this helps greatly. DNS is used in order to resolve the XMPP domain to a XMPP server. This is resolved, but then it seems that instead of using the XMPP domain in the XMPP stanza the XMPP server is used. I will prepare a patch in order to fix the underlying bug in a more graceful way.
Hi @pgstath. Are you still planning on patching this issue?
I can confirm that @lovetox's solution works as expected for my domain starbeamrainbowlabs.com what's the status of a patch here, @pgstath?
Hi,
i did setup a project with the basic xmpp server connect example from the documentation Documentation
it works with some servers, but i get the following exception
Sharp.Xmpp.XmppDisconnectionException: Unrecoverable stream error: host-unknown
when i want to connect to jabber.at
you dont need an account to try this, it fails even before a connection is established.
someone on stackoverfllow had the same problem, but there was no solution posted
stackoverflow