resolver: use SRV target as federation URL hostname - #480
Conversation
`actual_dest_3_3` and `actual_dest_4` returned the caller's `server_name` as the URL hostname while the IP override pointed at the SRV target. reqwest derives TLS SNI from that hostname, so behind an SNI-routing proxy, requests end up hitting the wrong backend. This commit routes both through `srv_url_dest` to track the SRV peer.
|
|
Hm, I guess I should've checked the spec instead of coming up with a hack out of frustration that diverges from the spec in an undesirable manner. It turns out I still had the deprecated That does raise another question though, should a resolution derived from a failed I would like to tackle that if that's fine with you. If it is, would you prefer I update this pr or make a new one? |
Detecting false It's probably better to open a new PR if the task has no overlap with this one. I would suggest running some experiments and thoroughly testing any changes to that area of code because it's very delicate and also mission-critical; the level of scrutiny for any PR would be above average. |
actual_dest_3_3andactual_dest_4returned the caller'sserver_nameas the URL hostname while the IP override pointed at the SRV target. reqwest derives TLS SNI from that hostname, so behind an SNI-routing proxy, requests end up hitting the wrong backend.This commit routes both through
srv_url_destto track the SRV peer.I ran into this when a synapse homeserver was down temporarily then came back up, causing many issues between chatting with users on that homeserver.