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

Federation .well-known requests don't follow 308 redirects #8098

Open
matrixbot opened this issue Dec 18, 2023 · 0 comments
Open

Federation .well-known requests don't follow 308 redirects #8098

matrixbot opened this issue Dec 18, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 18, 2023

This issue has been migrated from #8098.


Description

Synapse does not follow HTTP 308 (Permanent Redirect) redirects on .well-known files when resolving hosts for federation.

The problem seems to be that Synapse uses Twisted's RedirectAgent for handling .well-known redirects, which for whatever reason doesn't follow 308 redirects

Steps to reproduce

  • Set up a server with .well-known delegation behind a 308 redirect
  • Try to federate with that server

Expected result: federation works fine
Actual result: other servers will fail to fetch the .well-known and fall back to 8448, leading to federation not working

2020-08-07 21:50:39,593 - synapse.http.matrixfederationclient - 414 - INFO - GET-1685382- {GET-O-838751} [onscale.co.nz] Sending request: GET matrix://onscale.co.nz/_matrix/key/v2/server/ed25519%3Aa_YoJp; timeout 10.000000s
2020-08-07 21:50:39,594 - synapse.http.federation.well_known_resolver - 245 - INFO - GET-1685382- Fetching https://onscale.co.nz/.well-known/matrix/server
2020-08-07 21:50:40,851 - synapse.http.federation.well_known_resolver - 192 - INFO - GET-1685382- Error parsing well-known for b'onscale.co.nz': Non-200 response 308
2020-08-07 21:50:40,913 - synapse.http.federation.matrix_federation_agent - 250 - INFO - GET-1685382- Connecting to onscale.co.nz:8448
2020-08-07 21:50:49,598 - synapse.http.federation.matrix_federation_agent - 261 - INFO - GET-1685382- Failed to connect to onscale.co.nz:8448: HostnameAddress(hostname=b'onscale.co.nz', port=8448)

Version information

  • Version: 1.18
@matrixbot matrixbot changed the title Dummy issue Federation .well-known requests don't follow 308 redirects Dec 21, 2023
@matrixbot matrixbot reopened this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant