Skip to content

Commit 86ab57e

Browse files
authored
Specify IANA-registered service name (MSC4040) (#1624)
* Specify MSC4040 * add changelog * Fix flow of steps 4 and 5
1 parent 4f8b8a7 commit 86ab57e

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate `matrix` SRV lookup steps during server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `matrix-fed` SRV lookup steps to server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040).

content/server-server-api.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,28 +148,45 @@ to send. The process overall is as follows:
148148
Requests must be made with a `Host` header of
149149
`<delegated_hostname>:<delegated_port>`. The target server must
150150
present a valid certificate for `<delegated_hostname>`.
151-
3. If `<delegated_hostname>` is not an IP literal and no
151+
3. {{< added-in v="1.8" >}} If `<delegated_hostname>` is not an IP literal and no
152152
`<delegated_port>` is present, an SRV record is looked up for
153+
`_matrix-fed._tcp.<delegated_hostname>`. This may result in another
154+
hostname (to be resolved using AAAA or A records) and port.
155+
Requests should be made to the resolved IP address and port with
156+
a `Host` header containing the `<delegated_hostname>`. The
157+
target server must present a valid certificate for
158+
`<delegated_hostname>`.
159+
4. **[Deprecated]** If `<delegated_hostname>` is not an IP literal, no
160+
`<delegated_port>` is present, and a `_matrix-fed._tcp.<delegated_hostname>`
161+
SRV record was not found, an SRV record is looked up for
153162
`_matrix._tcp.<delegated_hostname>`. This may result in another
154163
hostname (to be resolved using AAAA or A records) and port.
155164
Requests should be made to the resolved IP address and port with
156165
a `Host` header containing the `<delegated_hostname>`. The
157166
target server must present a valid certificate for
158167
`<delegated_hostname>`.
159-
4. If no SRV record is found, an IP address is resolved using CNAME, AAAA
168+
5. If no SRV record is found, an IP address is resolved using CNAME, AAAA
160169
or A records. Requests are then made to the resolve IP address
161170
and a port of 8448, using a `Host` header of
162171
`<delegated_hostname>`. The target server must present a valid
163172
certificate for `<delegated_hostname>`.
164173

165-
4. If the `/.well-known` request resulted in an error response, a server is
174+
4. {{< added-in v="1.8" >}} If the `/.well-known` request resulted in an error response, a server is
175+
found by resolving an SRV record for `_matrix-fed._tcp.<hostname>`. This may
176+
result in a hostname (to be resolved using AAAA or A records) and
177+
port. Requests are made to the resolved IP address and port, with a `Host`
178+
header of `<hostname>`. The target server must present a valid certificate
179+
for `<hostname>`.
180+
181+
5. **[Deprecated]** If the `/.well-known` request resulted in an error response,
182+
and a `_matrix-fed._tcp.<hostname>` SRV record was not found, a server is
166183
found by resolving an SRV record for `_matrix._tcp.<hostname>`. This may
167184
result in a hostname (to be resolved using AAAA or A records) and
168185
port. Requests are made to the resolved IP address and port, with a `Host`
169186
header of `<hostname>`. The target server must present a valid certificate
170187
for `<hostname>`.
171188

172-
5. If the `/.well-known` request returned an error response, and the
189+
6. If the `/.well-known` request returned an error response, and the
173190
SRV record was not found, an IP address is resolved using CNAME, AAAA and A
174191
records. Requests are made to the resolved IP address using port
175192
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):
191208
> the name MUST NOT be an alias (in the sense of RFC 1034 or RFC 2181)
192209
{{% /boxes/note %}}
193210

211+
{{% boxes/note %}}
212+
Steps 3.4 and 5 are deprecated because they use a service name not registered by IANA.
213+
They may be removed in a future version of the specification. Server admins are encouraged
214+
to use `.well-known` over any form of SRV records.
215+
216+
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).
217+
{{% /boxes/note %}}
218+
194219
{{% http-api spec="server-server" api="wellknown" %}}
195220

196221
### Server implementation

0 commit comments

Comments
 (0)