gajim takes over 60 seconds to connect when no web server listening
Description
I discovered that when an xmpp server is being run without a web server, gajim consistently takes over 60 seconds to connect. This seems unreasonably long. After studying gajim's debug output, I noticed that connecting to my server caused the output:
(I) nbxmpp.addresses | Failed to retrieve host-meta file: 7 Could not connect: Socket I/O timed out
Connecting to other servers produced a different line instead:
(I) nbxmpp.addresses | Failed to retrieve host-meta file: 404 Not Found
So, I started up nginx on the server and both gajim started connecting quickly, and my gajim debug started showing the 404 line. Looking at my nginx access.log, I see:
"GET /.well-known/host-meta HTTP/1.1" 404 134 "-" "nbxmpp/3.1.1"
I believe this is covered by https://xmpp.org/extensions/xep-0156.html
What happens is gajim is performing this request for /.well-known/host-meta on port 443. If there is a web server listening and the resource does not exist, the server replies with a 404 and gajim moves to the next step in the connection process. If there is no web server response, gajim waits 60 seconds to timeout, then moves to the next step in the connection process.
I don't recall seeing any mention of the need for a running web server in any xmpp server documentation. I'm not sure what the proper fix is for this, but this seems like an unacceptably long wait time. Also, I'd like to prevent someone else from spending hours figuring out what is going on like I did, or even someone just living with it.
Steps to reproduce
- run xmpp server - prosody in this case - with no web server listening on port 443
- attempt to connect to server with gajim, either for account creation or after an account is configured
Expected behavior
Gajim connects in about 10 seconds or less
Actual behavior
Gajim takes about 66 seconds to connect