Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: try to connect to parent xmpp domain #1876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mightymop
Copy link
Contributor

If no dns entry was found for xmpp service subdomain, try to connect to xmpp domain host itself.

Example:

If the dns entry for conference.xmppdomain, pubsub.xmppdomain, search.xmppdomain was not set the method will now try to connect to the (parent) xmppdomain, cause the service will mostly run on the same host as the subdomain service.

@mightymop mightymop force-pushed the fallback_subdomain branch 6 times, most recently from 0473d43 to 3373169 Compare September 24, 2021 10:04
@guusdk
Copy link
Member

guusdk commented Sep 24, 2021

I'm thinking that this is behavior that's already in Openfire?

@mightymop
Copy link
Contributor Author

mightymop commented Sep 24, 2021

I'm thinking that this is behavior that's already in Openfire?

i think i have found an edge case:

For example:

i have a srv record for mopsdom.de, but a wildcard * for subdomains to another server which has nothing to do with xmpp

dig srv _xmpp-server._tcp.mopsdom.de
_xmpp-server._tcp.mopsdom.de. 300 IN    SRV     0 5 5269 www.mopsdom.de.

i used gajim and connected with an account to mopbook(xmppdomain) to make some service discoverys on mopsdom.de (xmppdomain) and i ran into:

  1. org.jivesoftware.openfire.net.SocketUtil.createSocketToXmppDomain which trys to get the host for mopsdom.de (thats working of cource)
  2. when i wanted to scan conference.mopsdom.de it gets resolved to the other server (because of wildcard for subdomains)
    remoteHost.getHost(); returns "conference.mopsdom.de" to realHostname
    so socket.connect( new InetSocketAddress... trys to open a connection to "conference.mopsdom.de" which of course will fail and then it jumps into catch block after timeout

i could reproduce this with other service subdomains (pubsub,...) too

then i inserted the fallback if the connection could not be established

Otherwhise for every xmpp-subdomain a cname entry to dns have to be inserted to overcome this issue...
But that is in the hands of the other administrator (receiver). So this could help the sender.

Copy link
Member

@Fishbowler Fishbowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a useful optimisation, and is disabled by default. LGTM 👍

…bdomain (service) was found...

add configuration property to enable/disable the fallback
@mightymop
Copy link
Contributor Author

rebased to current master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants