Specify IANA-registered service name (MSC4040) (#1624)

* Specify MSC4040

* add changelog

* Fix flow of steps 4 and 5
release/v1.8
Travis Ralston 1 year ago committed by GitHub
parent 4f8b8a746c
commit 86ab57ec4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1 @@
Deprecate `matrix` SRV lookup steps during server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040).

@ -0,0 +1 @@
Add `matrix-fed` SRV lookup steps to server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040).

@ -148,28 +148,45 @@ to send. The process overall is as follows:
Requests must be made with a `Host` header of Requests must be made with a `Host` header of
`<delegated_hostname>:<delegated_port>`. The target server must `<delegated_hostname>:<delegated_port>`. The target server must
present a valid certificate for `<delegated_hostname>`. present a valid certificate for `<delegated_hostname>`.
3. If `<delegated_hostname>` is not an IP literal and no 3. {{< added-in v="1.8" >}} If `<delegated_hostname>` is not an IP literal and no
`<delegated_port>` is present, an SRV record is looked up for `<delegated_port>` is present, an SRV record is looked up for
`_matrix-fed._tcp.<delegated_hostname>`. This may result in another
hostname (to be resolved using AAAA or A records) and port.
Requests should be made to the resolved IP address and port with
a `Host` header containing the `<delegated_hostname>`. The
target server must present a valid certificate for
`<delegated_hostname>`.
4. **[Deprecated]** If `<delegated_hostname>` is not an IP literal, no
`<delegated_port>` is present, and a `_matrix-fed._tcp.<delegated_hostname>`
SRV record was not found, an SRV record is looked up for
`_matrix._tcp.<delegated_hostname>`. This may result in another `_matrix._tcp.<delegated_hostname>`. This may result in another
hostname (to be resolved using AAAA or A records) and port. hostname (to be resolved using AAAA or A records) and port.
Requests should be made to the resolved IP address and port with Requests should be made to the resolved IP address and port with
a `Host` header containing the `<delegated_hostname>`. The a `Host` header containing the `<delegated_hostname>`. The
target server must present a valid certificate for target server must present a valid certificate for
`<delegated_hostname>`. `<delegated_hostname>`.
4. If no SRV record is found, an IP address is resolved using CNAME, AAAA 5. If no SRV record is found, an IP address is resolved using CNAME, AAAA
or A records. Requests are then made to the resolve IP address or A records. Requests are then made to the resolve IP address
and a port of 8448, using a `Host` header of and a port of 8448, using a `Host` header of
`<delegated_hostname>`. The target server must present a valid `<delegated_hostname>`. The target server must present a valid
certificate for `<delegated_hostname>`. certificate for `<delegated_hostname>`.
4. If the `/.well-known` request resulted in an error response, a server is 4. {{< added-in v="1.8" >}} If the `/.well-known` request resulted in an error response, a server is
found by resolving an SRV record for `_matrix-fed._tcp.<hostname>`. This may
result in a hostname (to be resolved using AAAA or A records) and
port. Requests are made to the resolved IP address and port, with a `Host`
header of `<hostname>`. The target server must present a valid certificate
for `<hostname>`.
5. **[Deprecated]** If the `/.well-known` request resulted in an error response,
and a `_matrix-fed._tcp.<hostname>` SRV record was not found, a server is
found by resolving an SRV record for `_matrix._tcp.<hostname>`. This may found by resolving an SRV record for `_matrix._tcp.<hostname>`. This may
result in a hostname (to be resolved using AAAA or A records) and result in a hostname (to be resolved using AAAA or A records) and
port. Requests are made to the resolved IP address and port, with a `Host` port. Requests are made to the resolved IP address and port, with a `Host`
header of `<hostname>`. The target server must present a valid certificate header of `<hostname>`. The target server must present a valid certificate
for `<hostname>`. for `<hostname>`.
5. If the `/.well-known` request returned an error response, and the 6. If the `/.well-known` request returned an error response, and the
SRV record was not found, an IP address is resolved using CNAME, AAAA and A SRV record was not found, an IP address is resolved using CNAME, AAAA and A
records. Requests are made to the resolved IP address using port records. Requests are made to the resolved IP address using port
8448 and a `Host` header containing the `<hostname>`. The target 8448 and a `Host` header containing the `<hostname>`. The target
@ -191,6 +208,14 @@ mandated by [RFC2782](https://www.rfc-editor.org/rfc/rfc2782.html):
> the name MUST NOT be an alias (in the sense of RFC 1034 or RFC 2181) > the name MUST NOT be an alias (in the sense of RFC 1034 or RFC 2181)
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
Steps 3.4 and 5 are deprecated because they use a service name not registered by IANA.
They may be removed in a future version of the specification. Server admins are encouraged
to use `.well-known` over any form of SRV records.
The IANA registration for port 8448 and `matrix-fed` can be found [here](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=matrix-fed).
{{% /boxes/note %}}
{{% http-api spec="server-server" api="wellknown" %}} {{% http-api spec="server-server" api="wellknown" %}}
### Server implementation ### Server implementation

Loading…
Cancel
Save