HTTP D. Damjanovic Internet-Draft Mozilla Intended status: Informational 19 October 2021 Expires: 22 April 2022 Advertising WebSocket support in the HTTPS resource record draft-damjanovic-websockets-https-rr-00 Abstract This specification introduces a way to advertise the support for the extended CONNECT feature that is used for running the WebSocket protocol over a single stream of an HTTP/2 and HTTP/3 connection using HTTPS resource records [HTTPSRR]. Note to Readers _RFC EDITOR: please remove this section before publication_ Discussion of this draft takes place on the HTTP working group mailing list (ietf-http-wg@w3.org), which is archived at https://lists.w3.org/Archives/Public/ietf-http-wg/ (https://lists.w3.org/Archives/Public/ietf-http-wg/). The source code and issues list for this draft can be found at https://github.com/ddragana/drafts (https://github.com/ddragana/ drafts). Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on 22 April 2022. Damjanovic Expires 22 April 2022 [Page 1] Internet-Draft Advertising WebSocket support in the HTT October 2021 Copyright Notice Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 3 3. Extending HTTPS DNS resource record . . . . . . . . . . . . . 3 4. The Client Behavior . . . . . . . . . . . . . . . . . . . . . 3 5. Security Considerations . . . . . . . . . . . . . . . . . . . 3 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 3 7. Normative References . . . . . . . . . . . . . . . . . . . . 4 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction The mechanisms for running the WebSocket protocol over a single stream of an HTTP/2 and HTTP/3 connection are defined in [RFC8441] and [WSHTTP3]. For bootstrapping WebSockets from HTTP/2 and HTTP/3 extended CONNECT is used. Support for the extended CONNECT is advertised using HTTP/2 and HTTP/3 settings (see [RFC7540] and [HTTP3]). Therefore, clients need to establish a HTTP/2 or HTTP/3 connection and wait for the setting frames to be exchanged to discover whether the connection can be used for the WebSocket requests. This specification adds a way to advertise the support for the extended CONNECT using HTTPS resource record [HTTPSRR] which will eliminate the need for a HTTP/2 or HTTP/3 connection and introduce delays. The clients can skip trying a HTTP/2 or HTTP/3 connection if the support for the extended CONNECT is not advertised. Damjanovic Expires 22 April 2022 [Page 2] Internet-Draft Advertising WebSocket support in the HTT October 2021 2. Conventions and Definitions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. 3. Extending HTTPS DNS resource record This specification introduces the "extended-connect" SvcParamKey (see [HTTPSRR]) that indicates that a particular service endpoint supports the extended CONNECT feature defined in [RFC8441] and [WSHTTP3]. The presentation and wire format values for the "extended-connect" SvcParamKey MUST be empty. If the "extended-connect" key is present, "alpn" MUST also be specified with at least the h2 or h3 value. 4. The Client Behavior Upon receiving a HTTPS RR, a client should use the "extended-connect" SvcParamKey as an indication whether a particular service endpoint supports the extended CONNECT feature. If the key is not present the client should not try using QUIC or TCP with the alpn set to h2 for requests that need the feature, e.g. WebSocket, and should directly use HTTP/1.1. If the key is present, that is a strong indication that the service endpoint supports the feature and the client should attempt using HTTP/2 or HTTP/3 protocol. Due to difficulties of deployments the client may discover that the feature, although advertised, is not supported and in this case the client should fallback to using HTTP/1.1. 5. Security Considerations This specification only adds a hint of whether a feature is supported or not and therefore, it does not introduce additional security considerations beyond one described in [RFC8441] and [WSHTTP3]. 6. IANA Considerations This specification adds the following entry to the Service Parameter Keys (SvcParamKeys) registry: Damjanovic Expires 22 April 2022 [Page 3] Internet-Draft Advertising WebSocket support in the HTT October 2021 +========+==================+=========================+===========+ | Number | Name | Meaning | Format | | | | | Reference | +========+==================+=========================+===========+ | 7 | extended-connect | Support of the extended | (This | | | | CONNECT feature | document) | | | | | Section 3 | +--------+------------------+-------------------------+-----------+ Table 1 7. Normative References [HTTP3] Bishop, M., "Hypertext Transfer Protocol Version 3 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- quic-http-34, 2 February 2021, . [HTTPSRR] Schwartz, B., Bishop, M., and E. Nygren, "Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)", Work in Progress, Internet-Draft, draft-ietf- dnsop-svcb-https-08, 12 October 2021, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC8441] McManus, P., "Bootstrapping WebSockets with HTTP/2", RFC 8441, DOI 10.17487/RFC8441, September 2018, . Damjanovic Expires 22 April 2022 [Page 4] Internet-Draft Advertising WebSocket support in the HTT October 2021 [WSHTTP3] Hamilton, R., "Bootstrapping WebSockets with HTTP/3", Work in Progress, Internet-Draft, draft-ietf-httpbis-h3- websockets-00, 9 September 2021, . Acknowledgments Author's Address Dragana Damjanovic Mozilla Email: dragana.damjano@gmail.com Damjanovic Expires 22 April 2022 [Page 5]