Although XMPP Core [1] specifies the use of TCP as the method of connecting to an XMPP server, alternative connection methods exist, including the BOSH (XEP-0124) [2] method (for which XMPP Over BOSH (XEP-0206) [3] is the XMPP profile), the websocket subprotocol specified in RFC 7395 [4], SRV records for XMPP over TLS (XEP-0368) [5], XMPP over QUIC (XEP-0467) [6], and WebSocket S2S (XEP-0468) [7], and surely others that don't yet exist. For some of these methods, it is necessary to discover further parameters before connecting, such as the HTTPS URL of a BOSH or WebSocket request. Without ways to auto-discover these parameters, the relevant information would need to be provided manually by a human user (which is cumbersome and error-prone) or hard-coded into XMPP software applications (which is brittle and not interoperable) ).
Additional things also require automatic discovery, like RFC 7711 [8] (replaced here by pinning public keys instead like RFC 7469 [9]), TLS Encrypted Client Hello [10], SNI names, and ALPN protocols.
This document defines a way to encapsulate information about all these connection methods and parameters for auto-discovery via Link entries in a server's "host-meta.json" file. It also provides a flag to signal to the client or server that all info is here and no other methods need be used.
The HTTPS lookup method uses Web Host Metadata RFC 6415 [11] to categorize and list the URIs of alternative connection methods. It is intended to replace all current methods for looking up connection information by "native" clients and servers, as well as be used by web browsers.
Each alternative connection method is specified in the host-meta.json (JRD) file using a distinctive link relation RFC 5988 [12]. This specification defines several extension relation types, here links are provided to their respective transport definitions:
And additionally re-uses some defined in Discovering Alternative XMPP Connection Methods (XEP-0156) [13]:
Additionally a top level "xmpp" object is defined, which currently has the following subfields defined:
The following are new fields defined in each link object:
The "href" field in websocket/bosh links remains unchanged from XEP-0156, but is replaced by "port" (integer) in Direct TLS/Quic connections.
The following business rules apply:
It is possible to use additionally a JSON-based format for host-meta information. The JSON representation of the host metadata is named JRD and specified in Appendix A of RFC 6415 [11]. The above XRD example would be presented in JRD as:
For the forseeable future you will need to maintain legacy SRV records in addition to this file, and you should provide DANE TLSA records too if possible.
To make your server as accessible to other clients/servers no matter how bad the network they are on, it is advised to use port 443 when possible, as it looks the most like HTTPS.
Extra care must be taken in updating "public-key-pins-sha-256" similar to that which is required of HPKP and DANE, summarized here, you MUST add the new key to the file, continue using the old key until least 2 TTL periods have passed, and only then remove the old key from the file and start using the new key.
To make connection discovery work in web clients (including those hosted on a different domain) the host service SHOULD set appropriate CORS headers for Web Host Metadata files. The exact headers and values are out of scope of this document but may include: Access-Control-Allow-Origin, Access-Control-Allow-Methods and Access-Control-Allow-Headers.
Due care has to be exercised in limiting the scope of Access-Control-Allow-Origin response header to Web Host Metadata files only.
Access-Control-Allow-Origin header with a value of * allows JavaScript code running on a different domain to read the content of Web Host Metadata files. Special value * ensures that the request will only succeed if it is invoked without user credentials (e.g. cookies, HTTP authentication).
As an author of a client or server, you presumably have users, and those users have a single desire, to communicate over XMPP. This means that they want to connect at any costs, they *do not* want to see the first error to appear and have all further attempts aborted until it's fixed. With this problem statement, here is a list of current best practices to make this happen:
Keep in mind this json file is defined in an RFC and we need to keep backwards compatibility with it, software only implementing XEP-0156 should be able to read and use this file as extended by this XEP only seeing the websocket/bosh connections.
At the time of this writing, connecting to an XMPP server requires at least 5 seperate fetches of data, and doesn't support half the things this XEP does. I don't find adding more fetches a sustainable path forward, hence definining one extensible method for all things going forward.
Here I will go through alternative solutions that were explored and explain their deficiencies and why they were not chosen.
It should be noted this allows your web host to hijack your XMPP connection, but that's actually been true for quite some time, they could already bypass the need for a certificate with POSH, or get one from LetsEncrypt if you didn't have the proper CAA records, or hijack it for websocket/bosh supporting clients, so this doesn't really open up new avenues of attack.
Please refer to the security considerations and warnings of RFC 7469 [9] with regards to having a backup public key and being careful to not break your domain for the whole TTL. For this reason and others it is advised to put a max limit on TTL of 1 week (604800).
Validating certs is full of edge cases and must be done with the utmost of care and precision.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [16].
This document requires no interaction with the XMPP Registrar [17].
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the <xsf-ietf@xmpp.org> list might also be appropriate.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.
2. XEP-0124: Bidirectional-streams Over Synchronous HTTP <https://xmpp.org/extensions/xep-0124.html>.
3. XEP-0206: XMPP Over BOSH <https://xmpp.org/extensions/xep-0206.html>.
4. RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket <http://tools.ietf.org/html/rfc7395>.
5. XEP-0368: SRV records for XMPP over TLS <https://xmpp.org/extensions/xep-0368.html>.
6. XEP-0467: XMPP over QUIC <https://xmpp.org/extensions/xep-0467.html>.
7. XEP-0468: WebSocket S2S <https://xmpp.org/extensions/xep-0468.html>.
8. RFC 7711: PKIX over Secure HTTP (POSH)<http://tools.ietf.org/html/rfc7711>.
9. RFC 7469: Public Key Pinning Extension for HTTP <http://tools.ietf.org/html/rfc7469>.
10. TLS Encrypted Client Hello <http://tools.ietf.org/html/draft-ietf-tls-esni/>.
11. RFC 6415: Web Host Metadata <http://tools.ietf.org/html/rfc6415>.
12. RFC 5988: Web Linking <http://tools.ietf.org/html/rfc5988>.
13. XEP-0156: Discovering Alternative XMPP Connection Methods <https://xmpp.org/extensions/xep-0156.html>.
14. RFC 2782: A DNS RR for specifying the location of services (DNS SRV) <http://tools.ietf.org/html/rfc2782>.
15. RFC 9460: Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records) <http://tools.ietf.org/html/rfc9460>.
16. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
17. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
First draft.
@report{burtrum2023connections-v2, title = {Host Meta 2 - One Method To Rule Them All}, author = {Burtrum, Travis}, type = {XEP}, number = {0487}, version = {0.1.0}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-0487.html}, date = {2023-11-19/2024-03-10}, }
END