Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

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

@tulir

Description

@tulir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FederationZ-Upstream-BugThis issue requires a fix in an upstream dependency.z-bug(Deprecated Label)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions