Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-XMPP CPAN distribution.

Report information
The Basics
Id: 18539
Status: resolved
Priority: 2/
Queue: Net-XMPP

People
Owner: dapatrick [...] cpan.org
Requestors: arnaud.abelard [...] univ-nantes.fr
Cc: CARNIL [...] cpan.org
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 1.02_01



Subject: no support for xmpp domains using SRV
It's not possible to use Net::XMPP to connect a jabber server when the server's hostname doesn't match the right side of the jid: for example, for user@gmail.com $Con = new Net::XMPP::Client(); $Con->Execute(hostname=>"gmail.com", username=>"user", password=>"password", resource=>"Work"); will not work, because gmail.com isn't the jabber server. the available servers can be fetched with a SRV DNS request: host -t SRV _xmpp-client._tcp.gmail.com _xmpp-client._tcp.gmail.com SRV 20 0 5222 talk4.l.google.com. _xmpp-client._tcp.gmail.com SRV 5 0 5222 talk.l.google.com. _xmpp-client._tcp.gmail.com SRV 20 0 5222 talk1.l.google.com. _xmpp-client._tcp.gmail.com SRV 20 0 5222 talk2.l.google.com. _xmpp-client._tcp.gmail.com SRV 20 0 5222 talk3.l.google.com. but then using the server's hostname will not work since the resulting jid user@hostname is not right. the XMPP RFC suggest that the SRV request has to be done (http://www.xmpp.org/specs/rfc3921.html): If the hostname of the domain identifier portion of the address contained in the 'to' attribute of an outbound stanza does not match a hostname of the server itself, the server MUST attempt to route the stanza to the foreign domain. The recommended order of actions is as follows: 1. First attempt to resolve the foreign hostname using an [SRV]Gulbrandsen, A., Vixie, P. and L. Esibov, A DNS RR for specifying the location of services (DNS SRV), February 2000. Service of "xmpp-server" and Proto of "tcp", resulting in resource records such as "_xmpp-server._tcp.example.com.", as specified in [XMPP-CORE]Saint-Andre, P., Extensible Messaging and Presence Protocol (XMPP): Core, October 2004.
From: thomas-bugscpanorg [...] fabritius.org
In my case it works perfectly using the existing support for SRV in XML::Stream (Net::DNS::Resolver required). I just added these two lines after line 143 in Net::XMPP::Connection: srv => '_xmpp-client._tcp', to => $self->{SERVER}->{hostname}, I've done not much testing - just happy that it works ;) Does anybody care about Net::XMPP? Looks quite abandoned :-(
This bug has been patched and committed. The source tree is available at http://github.com/dap/Net-XMPP. A developer release should be published to CPAN by 2010-09-26. Darian
On Sun Sep 19 00:37:08 2010, DAPATRICK wrote: Show quoted text
> This bug has been patched and committed. The source tree is available at > http://github.com/dap/Net-XMPP. A developer release should be published > to CPAN by 2010-09-26.
Would you please care to make a release of Net::XMPP? It is quite annoying to spend a day hunting the application problem only to find out that it is in fact a Net::XMPP problem, which has been reported several years ago, apparently fixed in Git year and half ago, yet still not available at CPAN in a "stable/official" release. Thanks! -Yenya