Consider:
example.org_matrix._tcp.example.org has SRV record 1 1 443 matrix.example.org.Synapse sends federation requests to https://matrix.example.org, which is correct, but it uses wrong hostname (example.org instead of matrix.example.org) and also doesn't use SNI (which is a known issue, though, #1491).
The problem is here:
MatrixFederationHttpClient uses original server name, before DNS resolution.
I'm failing to understand why this isn't a dup of #1491
Ooops, it indeed is. The comments of that issue mostly discussed SNI, and I failed to read the original post carefully.
This specific point was discussed in the context of dendrite today; the conclusion was that the current behaviour is actually correct.
Here are our reasons:
This decision is kind of security by obscurity. Use DNSSEC instead.
Most helpful comment
This decision is kind of security by obscurity. Use DNSSEC instead.