-
ilmaisin
Hello
-
ilmaisin
i cannot for some reason open s2s connections from domain laiho.me to xmpp.org though i have properly set up certificates now
-
ilmaisin
from xmpp2.laiho.me i can federate just fine, even when it is hosted in the same instance
-
ilmaisin
I run ejabberd
-
ilmaisin
At ejabberd discussion forum they suggested that there could be a some sort of stuck connection
-
Ellenor Malik
ah
-
zp1.net
What error message do you get?
-
zp1.net
I run a prosody but i had something similar when my SRV entries in the DNS where buggy
-
ilmaisin
My srv entries are just fine
-
ilmaisin
> What error message do you get? I get connection timeouts
-
ilmaisin
Now i cannot join the conversation's muc either
-
ilmaisin
I am so going to nuke my xmpp server, i am fed up with this stuff
-
mieum
anyone have experience running an xmpp server behind a reverse proxy?
-
mieum
i've got prosody in an lxc container, with nginx directing streams on all xmpp ports to the container, and it works...but prosody is aware of the fact that the container and host IPs mismatch.
-
mieum
I've treid using the proxy_bind directive, but it breaks the stream >_<
-
mieum
maybe it doesn't matter so long as everything works?
-
mieum
seems like it *could* cause problems...
-
MattJ
ilmaisin: I'm an admin of xmpp.org, I can take a look at the logs later today and see if I can spot any issues connecting to your domain
-
ilmaisin
> ilmaisin: I'm an admin of xmpp.org, I can take a look at the logs later today and see if I can spot any issues connecting to your domain It would be great, thanks
-
MattJ
mieum: when you say "it is aware" - what do you mean? Is there a problem?
-
mieum
it works fine, but it thinks that dns isn't configured properly, beause the A record points to the IP of the host machine and not the container itself
-
mieum
I haven't figured out how to bind the stream to the host IP like you could with http headers. But, I'm not sure it matters...
-
mieum
so far it all works great haha
-
mieum
I am just unsure if there will be unforeseen issues because of it later
-
MattJ
If you're just worried about the output of prosodyctl check, don't be. There is expected to be an IP mismatch in this kind of setup
-
mieum
okay thanks MattJ :b I will rest assured haha
-
MattJ
But yes, Prosody won't know the real IP address of connections, and that brings some limitations
-
mieum
what sorts of limitations?
-
MattJ
E.g. don't try rate-limiting things that are based on IP address
-
mieum
ah i see
-
Julian
mieum: HAProxy developed a "Proxy Protocol" to deal with this problem. Nginx and Ejabberd have very good support for it. Maybe Prosody does support it as well.
-
mieum
Julian, I am using the proxy_protocol directive in nginx to listen on the xmpp ports.
-
MattJ
Prosody does support it, I wasn't aware nginx does... that's good to know :)
-
mieum
I've been using it with other non-http tcp streams, and it works really well! I was just alarmed by prosody's warning, which seems harmless like you said MattJ
-
mieum
maybe if I tinker more I can figure out how to properly bind the IPs in this case
-
Julian
Ok, maybe I misunderstood your problem. Anyway the limitations MattJ mentioned e.g. rate-limits per IP should be solved by using it.
-
mieum
Julian, are you using the proxy protocol that way with your server?
-
mieum
I'd be curious what solutions folks have come up with. I'm sure lots of people have been down this road before me :b
-
Julian
Yes, I do. I have nginx and ejabberd running on different hosts, connected via VPN. All incomming connections are accepted by nginx and passed to ejabberd using the proxy protocol.
-
ilmaisin
MattJ: also if you could try restarting the server to get rid of stuck connections? I have heard that prsosody sometimes has that kind of issues
-
MattJ
That was an issue that happened multiple years ago and was fixed
-
MattJ
Obviously I can't rule out a bug without checking, but I consider it unlikely and I don't plan to restart the server without reason
-
MattJ
I'll be at my laptop in an hour or so, then I can look into it
-
mieum
Julian, that's an interesting setup! are you using thr proxy_bind directive anywhere? is it irrelevant in this case?
-
Holger
MattJ: > That was an issue that happened multiple years ago and was fixed Oh I wasn't aware it's fixed. I felt it's not long ago this happened with muc.xmpp.org, and <https://issues.prosody.im/871> doesn't mention a fix?
-
Julian
mieum: I dont use proxy_bind anywhere. For my understanding the only usecase for this directive is as fallback if the backend doesnt support the proxy protocol. But I may be wrong about this.
-
mieum
Julian, that makes sense. For now I guess I will continue forwarding the streams with the proxy_protocol directive. So far I haven't encountered any actual problems
-
mieum
I just want anticipate future issues before too many people depend on the server
-
mieum
It's cool that it just works :) more people sgould host their own servers hehe
-
MattJ
Holger, I don't recall any recent reports of issues with muc.xmpp.org since we upgraded it. It was stuck on an old release for a long time due to an outdated OS, but it's all up to date now.
-
MattJ
And iirc the actual issue with xmpp.org back then was due to DNS resolution problems
-
MattJ
But my memory is hazy
-
Holger
I see.
-
Holger
I'll take note of the Prosody version whenever it looks like this issue again.
-
MattJ
That bug report was made against the 0.9 branch, we're now on 0.11, and many things have changed. We need to do some issue tracker cleanup :)
-
Holger
I've seen it every now and then until recently, but not sure with what servers/versions.
-
MattJ
There are a handful of things that could be responsible for the same symptoms, for example previous versions of Debian shipped with a libevent binding that had buggy timer handling (so timers to clean up dead streams may not trigger), for example
-
MattJ
If you actually do see it in the wild on an up to date server I'm interested to know about that
-
MattJ
Anyway, checking muc.xmpp.org logs, everything seems to be okay with the domain mentioned above...?
-
MattJ
It's actually doing XEP-0199 pings, and they are being answered
-
MattJ
ilmaisin, it looks like you moved servers and updated DNS, but there was still a connection open to the previous server and it was still answering for the old domain
-
MattJ
I just force-closed the connection and hopefully the next attempt will see the new DNS records and connect to your new server
-
Licaon_Kter
_It's always DNS_ :)
-
MattJ
Minor note, your DNS is technically against the rules in the SRV RFC, which states that the target of a SRV record should not be a CNAME
-
MattJ
Prosody, and probably most/all XMPP servers handle that anyway (it's a common mistake), but you may want to fix it anyway just in case something enforces the rules strictly
-
ilmaisin
Yeah, i'll take a look at it. Cloudflare's "cname flattening" will probably do the trick
-
iiro
MattJ: now it works, thanks alot!
-
MattJ
Excellent :)
-
iiro
Btw, why does xmpp stuff require certificates to be valid for the main domain too in this kind of configuration? I am not at all sure if it is net positive for security, since one compromising the xmpp server can compromise everything on the main domain too
-
Holger
iiro, actually only the actual service domains are required to be certified, not the host running the service.
-
Holger
iiro, otherwise you'd have to trust the DNS lookup.
-
iiro
Popularizing posh support for s2s would be nice
-
Holger
iiro, i.e. my client would look up your domain, the attacker would 'just' have to manage to return attacker.example.com for that lookup, and could then offer a valid cert for attacker.example.com.
-
Holger
iiro, the problem you mention could be solved by having service-specific certificates. Google and the rest of the browser lobby forbids large CAs to do that.
-
Holger
And as everything is HTTPS these days anyway, there's no lobby against that nonsense.
-
iiro
Yeah, but someone capable of editing dns can also get certificates
-
Holger
iiro, what.
-
iiro
Lets encrypt does dns validation
-
Holger
iiro, certificate validation is all about avoiding an attacker becoming MITM.
-
Holger
iiro, an attacker with write access on the network path between you and your peer, that is.
-
Holger
iiro, yes but attacking the way Let's Encrypt performs DNS validation is way, way harder than attacking your lookup in a lookup cafe WiFi.✎ -
Holger
iiro, yes but attacking the way Let's Encrypt performs DNS validation is way, way harder than attacking your lookup in a cafe WiFi. ✏
-
iiro
Yeah, but i doubt anyone runs an xmpp server on a cafe wifi
-
Holger
People run clients in cafes.
-
Holger
If you're arguing that DNS traffic can't (easily) be forged in practice then I'd disagree. But if you were right, for what would we need certificates?
-
iiro
I am not really arguing, more like wondering. I just fear that current certificate infrastructure is over-reliant on dns anyway
-
iiro
Though doing the dns queries from many places might prevent certain kinds of attacks
-
MattJ
I agree - it's marginally better an verification than the old dialback protocol was (because Let's Encrypt queries from more places than a random XMPP server typically would), and they have some other protections
-
MattJ
As for which hostname to present, it makes sense to me that you need to present a certificate for the domain that you are claiming to be, regardless of your actual network address
-
MattJ
Unless a secure chain of trust from the service name to the network address can be established
-
MattJ
If I'm connecting to microsoft.com and DNS resolves to evil.example.com, I'd like to see a cert for microsoft.com, rather than evil.example.com to prove that I'm speaking to the right entity
-
MattJ
Unless I have some more secure way than unencrypted unsigned DNS to validate that microsoft.com really wants evil.example.com to handle their XMPP traffic for them
-
MattJ
FYI I closed that issue report: https://issues.prosody.im/871#comment-7
-
iiro
Perhaps there could be an exception that xmpp.example.com would be considered as good as example.com for xmpp purposes
-
iiro
But that too would require consensus
-
croax
POSH as is a nice and easy to set-up alternative solution but does not seem to be massively accepted at least regarding s2s. It also makes delegation easy for domains you don't own.
-
MattJ
Yeah, I think it's worth pushing POSH more. Also there are promising rumours about service certificates coming from the CAB forum, but we'll see if anything actually happens.
-
croax
Sure, hearing from this for a long time. Finger crossed :-)✎ -
croax
Sure, hearing from this for a long time. Fingers crossed :-) ✏
-
stpeter
Wow, POSH. :-) I'll see Matt Miller at lunch today and mention this to him. :-)
-
MattJ
:)
-
mimi89999
Establishing a secure connection from lebihan.pl to tamytro.org failed. Certificate hash: 7ae362479e00b32a753eceb275fb93bf2a883399931f4598495d45c8099453a4. Error with certificate 0: certificate has expired.