<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.10 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr="trust200902" docName="draft-schinazi-masque-00" category="exp">

  <front>
    <title abbrev="MASQUE">The MASQUE Protocol</title>

    <author initials="D." surname="Schinazi" fullname="David Schinazi">
      <organization>Google LLC</organization>
      <address>
        <postal>
          <street>1600 Amphitheatre Parkway</street>
          <city>Mountain View, California 94043</city>
          <country>United States of America</country>
        </postal>
        <email>dschinazi.ietf@gmail.com</email>
      </address>
    </author>

    <date year="2019" month="February" day="28"/>

    
    
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This document describes MASQUE (Multiplexed Application Substrate over QUIC
Encryption). MASQUE is a mechanism that allows co-locating and obfuscating
networking applications behind an HTTPS web server. The currently prevalent
use-case is to allow running a VPN server that is indistinguishable from an
HTTPS server to any unauthenticated observer. We do not expect major providers
and CDNs to deploy this behind their main TLS certificate, as they are not
willing to take the risk of getting blocked, as shown when domain fronting
was blocked. An expected use would be for individuals to enable this behind
their personal websites via easy to configure open-source software.</t>

<t>This document is a straw-man proposal. It does not contain enough details to
implement the protocol, and is currently intended to spark discussions on
the approach it is taking. As we have not yet found a home for this work,
discussion is encouraged to happen on the GitHub repository which contains
the draft: <eref target="https://github.com/DavidSchinazi/masque-drafts">https://github.com/DavidSchinazi/masque-drafts</eref>.</t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>This document describes MASQUE (Multiplexed Application Substrate over QUIC
Encryption). MASQUE is a mechanism that allows co-locating and obfuscating
networking applications behind an HTTPS web server. The currently prevalent
use-case is to allow running a VPN server that is indistinguishable from an
HTTPS server to any unauthenticated observer. We do not expect major providers
and CDNs to deploy this behind their main TLS certificate, as they are not
willing to take the risk of getting blocked, as shown when domain fronting
was blocked. An expected use would be for individuals to enable this behind
their personal websites via easy to configure open-source software.</t>

<t>This document is a straw-man proposal. It does not contain enough details to
implement the protocol, and is currently intended to spark discussions on
the approach it is taking. As we have not yet found a home for this work,
discussion is encouraged to happen on the GitHub repository which contains
the draft: <eref target="https://github.com/DavidSchinazi/masque-drafts">https://github.com/DavidSchinazi/masque-drafts</eref>.</t>

<t>MASQUE leverages the efficient head-of-line blocking prevention features of
the QUIC transport protocol <xref target="I-D.ietf-quic-transport"/> when MASQUE is used
in an HTTP/3 <xref target="I-D.ietf-quic-http"/> server. MASQUE can also run in an
HTTP/2 server <xref target="RFC7540"/> but at a performance cost.</t>

<section anchor="conventions-and-definitions" title="Conventions and Definitions">

<t>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 <xref target="RFC2119"/> <xref target="RFC8174"/>
when, and only when, they appear in all capitals, as shown here.</t>

</section>
</section>
<section anchor="requirements" title="Requirements">

<t>This section describes the goals and requirements chosen for the MASQUE
protocol.</t>

<section anchor="invisibility-of-vpn-usage" title="Invisibility of VPN Usage">

<t>An authenticated client using the VPN appears to observers as a regular HTTPS
client. Observers only see that HTTP/3 or HTTP/2 is being used over an
encrypted channel. No part of the exchanges between client and server may
stick out. Note that traffic analysis is currently considered out of scope.</t>

</section>
<section anchor="invisibility-of-the-server" title="Invisibility of the Server">

<t>To anyone without private keys, the server is indistinguishable from a regular
web server. It is impossible to send an unauthenticated probe that the server
would reply to differently than if it were a normal web server.</t>

</section>
<section anchor="fallback-to-http2-over-tls-over-tcp" title="Fallback to HTTP/2 over TLS over TCP">

<t>When QUIC is blocked, MASQUE can run over TCP and still satisfy
previous requirements. Note that in this scenario performance may be
negatively impacted.</t>

</section>
</section>
<section anchor="overview-of-the-mechanism" title="Overview of the Mechanism">

<t>The server runs an HTTPS server on port 443, and has a valid TLS certificate
for its domain. The client has a public/private key pair, and the server
maintains a list of authorized MASQUE clients, and their public key.
(Alternatively, clients can also be authenticated using a shared secret.)
The client starts by establishing a regular HTTPS connection to the server
(HTTP/3 over QUIC or HTTP/2 over TLS 1.3 <xref target="RFC8446"/> over TCP), and validates
the server’s TLS certificate as it normally would for HTTPS. If validation
fails, the connection is aborted. The client then uses a TLS keying material
exporter <xref target="RFC5705"/> with label “EXPORTER-masque” and no context to generate a
32-byte key. This key is then used as a nonce to prevent replay attacks. The
client then sends an HTTP CONNECT request for “/.well-known/masque/initial”
with the :protocol pseudo-header field set to “masque”, and a
“Masque-Authentication:” header. The MASQUE authentication header differs
from the HTTP “Authorization” header in that it applies to the underlying
connection instead of being per-request. It can use either a shared secret
or asymmetric authentication. The asymmetric variant uses authentication
method “PublicKey”, and it transmits a signature of the nonce with the
client’s public key encoded in base64 format, followed by other information
such as the client username and signature algorithm OID. The symmetric
variant uses authentication method “HMAC” and transmits an HMAC of the
nonce with the shared secret instead of a signature. For example this header
could look like:</t>

<figure title="MASQUE Authentication Format Example" anchor="auth-format"><artwork><![CDATA[
Masque-Authentication: PublicKey u="am9obi5kb2U=";a=1.3.101.112;
s="SW5zZXJ0IHNpZ25hdHVyZSBvZiBub25jZSBoZXJlIHdo
aWNoIHRha2VzIDUxMiBiaXRzIGZvciBFZDI1NTE5IQ=="

Masque-Authentication: HMAC u="am9obi5kb2U=";a=2.16.840.1.101.3.4.2.3;
s="SW5zZXJ0IHNpZ25hdHVyZSBvZiBub25jZSBoZXJlIHdo
aWNoIHRha2VzIDUxMiBiaXRzIGZvciBFZDI1NTE5IQ=="
]]></artwork></figure>

<t>When the server receives this CONNECT request, it verifies the signature and
if that fails responds with code “405 Method Not Allowed”, making sure its
response is the same as what it would return for any unexpected CONNECT
request. If the signature verifies, the server responds with code
“101 Switching Protocols”, and from then on this HTTP stream is now dedicated
to the MASQUE protocol. That protocol provides a reliable bidirectional
message exchange mechanism, which is used by the client and server to
negotiate what protocol options are supported and enabled by policy, and
client VPN configuration such as IP addresses. When using QUIC, this protocol
also allows endpoints to negotiate the use of QUIC extensions, such as support
for the DATAGRAM extension <xref target="I-D.pauly-quic-datagram"/>.</t>

</section>
<section anchor="mechanisms-the-server-can-advertise-to-authenticated-clients" title="Mechanisms the Server Can Advertise to Authenticated Clients">

<t>Once a server has authenticated the client’s MASQUE CONNECT request,
it advertises services that the client may use. These services allow
for example varying degrees of proxying services to help a client
obfuscate the ultimate destination of their traffic.</t>

<section anchor="http-proxy" title="HTTP Proxy">

<t>The client can make proxied HTTP requests through the server to other
servers. In practice this will mean using the CONNECT method to establish a
stream over which to run TLS to a different remote destination.</t>

</section>
<section anchor="dns-over-https" title="DNS over HTTPS">

<t>The client can send DNS queries using DNS over HTTPS (DoH) <xref target="RFC8484"/>
to the MASQUE server.</t>

</section>
<section anchor="udp-proxying" title="UDP Proxying">

<t>In order to support WebRTC or QUIC to further servers, clients need a way to
relay UDP onwards to a remote server. In practice for most widely deployed
protocols other than DNS, this involves many datagrams over the same ports.
Therefore this mechanism implements that efficiently: clients can use the
MASQUE protocol stream to request an UDP association to an IP address and
UDP port pair. In QUIC, the server would reply with a DATAGRAM_ID that the
client can then use to have UDP datagrams sent to this remote server.
Datagrams are then simply transferred between the DATAGRAMs with this ID and
the outer server. There will also be a message on the MASQUE protocol stream
to request shutdown of a UDP association to save resources when it is no
longer needed. When running over TCP, the client opens a new stream with a
CONNECT request to the “masque-udp-proxy” protocol and then sends datagrams
encapsulated inside the stream with a two-byte length prefix in network byte
order. The target IP and port are sent as part of the URL query. Resetting
that stream instructs the server to release any associates resources.</t>

</section>
<section anchor="ip-proxying" title="IP Proxying">

<t>For the rare cases where the previous mechanisms are not sufficient, proxying
can be performed at the IP layer. This would use a different DATAGRAM_ID and
IP datagrams would be encoded inside it without framing. Over TCP, a dedicated
stream with two byte length prefix would be used. The server can inspect the
IP datagram to look for the destination address in the IP header.</t>

</section>
<section anchor="path-mtu-discovery" title="Path MTU Discovery">

<t>In the main deployment of this mechanism, QUIC will be used between client
and server, and that will most likely be the smallest MTU link in the path
due to QUIC header and authentication tag overhead. The client is responsible
for not sending overly large UDP packets and notifying the server of the low
MTU. Therefore PMTUD is currently seen as out of scope of this document.</t>

</section>
</section>
<section anchor="security-considerations" title="Security Considerations">

<t>Here be dragons. TODO: slay the dragons.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>We will need to register:</t>

<t><list style="symbols">
  <t>the TLS keying material exporter label “EXPORTER-masque” (spec required)</t>
</list></t>
<t><eref target="https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels">https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels</eref></t>

<t><list style="symbols">
  <t>the new HTTP header “Masque-Authentication”</t>
</list></t>
<t><eref target="https://www.iana.org/assignments/message-headers/message-headers.xhtml">https://www.iana.org/assignments/message-headers/message-headers.xhtml</eref></t>

<t><list style="symbols">
  <t>the “/.well-known/masque/” URI (expert review)</t>
</list></t>
<t><eref target="https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml">https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml</eref></t>

<t><list style="symbols">
  <t>The “masque” and “masque-udp-proxy” extended HTTP CONNECT protocols</t>
</list></t>

<t>We will also need to define the MASQUE control protocol and that will be
likely to define new registries of its own.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor="RFC2119" target='https://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference  anchor="RFC5705" target='https://www.rfc-editor.org/info/rfc5705'>
<front>
<title>Keying Material Exporters for Transport Layer Security (TLS)</title>
<author initials='E.' surname='Rescorla' fullname='E. Rescorla'><organization /></author>
<date year='2010' month='March' />
<abstract><t>A number of protocols wish to leverage Transport Layer Security (TLS) to perform key establishment but then use some of the keying material for their own purposes.  This document describes a general mechanism for allowing that.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='5705'/>
<seriesInfo name='DOI' value='10.17487/RFC5705'/>
</reference>



<reference  anchor="RFC7540" target='https://www.rfc-editor.org/info/rfc7540'>
<front>
<title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
<author initials='M.' surname='Belshe' fullname='M. Belshe'><organization /></author>
<author initials='R.' surname='Peon' fullname='R. Peon'><organization /></author>
<author initials='M.' surname='Thomson' fullname='M. Thomson' role='editor'><organization /></author>
<date year='2015' month='May' />
<abstract><t>This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2).  HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection.  It also introduces unsolicited push of representations from servers to clients.</t><t>This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax.  HTTP's existing semantics remain unchanged.</t></abstract>
</front>
<seriesInfo name='RFC' value='7540'/>
<seriesInfo name='DOI' value='10.17487/RFC7540'/>
</reference>



<reference  anchor="RFC8174" target='https://www.rfc-editor.org/info/rfc8174'>
<front>
<title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
<author initials='B.' surname='Leiba' fullname='B. Leiba'><organization /></author>
<date year='2017' month='May' />
<abstract><t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='8174'/>
<seriesInfo name='DOI' value='10.17487/RFC8174'/>
</reference>



<reference  anchor="RFC8446" target='https://www.rfc-editor.org/info/rfc8446'>
<front>
<title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
<author initials='E.' surname='Rescorla' fullname='E. Rescorla'><organization /></author>
<date year='2018' month='August' />
<abstract><t>This document specifies version 1.3 of the Transport Layer Security (TLS) protocol.  TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t><t>This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961.  This document also specifies new requirements for TLS 1.2 implementations.</t></abstract>
</front>
<seriesInfo name='RFC' value='8446'/>
<seriesInfo name='DOI' value='10.17487/RFC8446'/>
</reference>



<reference  anchor="RFC8484" target='https://www.rfc-editor.org/info/rfc8484'>
<front>
<title>DNS Queries over HTTPS (DoH)</title>
<author initials='P.' surname='Hoffman' fullname='P. Hoffman'><organization /></author>
<author initials='P.' surname='McManus' fullname='P. McManus'><organization /></author>
<date year='2018' month='October' />
<abstract><t>This document defines a protocol for sending DNS queries and getting DNS responses over HTTPS.  Each DNS query-response pair is mapped into an HTTP exchange.</t></abstract>
</front>
<seriesInfo name='RFC' value='8484'/>
<seriesInfo name='DOI' value='10.17487/RFC8484'/>
</reference>



<reference anchor="I-D.ietf-quic-http">
<front>
<title>Hypertext Transfer Protocol Version 3 (HTTP/3)</title>

<author initials='M' surname='Bishop' fullname='Mike Bishop'>
    <organization />
</author>

<date month='January' day='22' year='2019' />

<abstract><t>The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment.  This document describes a mapping of HTTP semantics over QUIC.  This document also identifies HTTP/2 features that are subsumed by QUIC, and describes how HTTP/2 extensions can be ported to HTTP/3.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-quic-http-18' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-quic-http-18.txt' />
</reference>



<reference anchor="I-D.ietf-quic-transport">
<front>
<title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>

<author initials='J' surname='Iyengar' fullname='Jana Iyengar'>
    <organization />
</author>

<author initials='M' surname='Thomson' fullname='Martin Thomson'>
    <organization />
</author>

<date month='January' day='22' year='2019' />

<abstract><t>This document defines the core of the QUIC transport protocol. Accompanying documents describe QUIC's loss detection and congestion control and the use of TLS for key negotiation.  Note to Readers  Discussion of this draft takes place on the QUIC working group mailing list (quic@ietf.org), which is archived at &lt;https://mailarchive.ietf.org/arch/search/?email_list=quic>.  Working Group information can be found at &lt;https://github.com/ quicwg>; source code and issues list for this draft can be found at &lt;https://github.com/quicwg/base-drafts/labels/-transport>.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-quic-transport-18' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-quic-transport-18.txt' />
</reference>



<reference anchor="I-D.pauly-quic-datagram">
<front>
<title>An Unreliable Datagram Extension to QUIC</title>

<author initials='T' surname='Pauly' fullname='Tommy Pauly'>
    <organization />
</author>

<author initials='E' surname='Kinnear' fullname='Eric Kinnear'>
    <organization />
</author>

<author initials='D' surname='Schinazi' fullname='David Schinazi'>
    <organization />
</author>

<date month='February' day='6' year='2019' />

<abstract><t>This document defines an extension to the QUIC transport protocol to add support for sending and receiving unreliable datagrams over a QUIC connection.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-pauly-quic-datagram-02' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-pauly-quic-datagram-02.txt' />
</reference>




    </references>

    <references title='Informative References'>





<reference  anchor="RFC7427" target='https://www.rfc-editor.org/info/rfc7427'>
<front>
<title>Signature Authentication in the Internet Key Exchange Version 2 (IKEv2)</title>
<author initials='T.' surname='Kivinen' fullname='T. Kivinen'><organization /></author>
<author initials='J.' surname='Snyder' fullname='J. Snyder'><organization /></author>
<date year='2015' month='January' />
<abstract><t>The Internet Key Exchange Version 2 (IKEv2) protocol has limited support for the Elliptic Curve Digital Signature Algorithm (ECDSA). The current version only includes support for three Elliptic Curve groups, and there is a fixed hash algorithm tied to each group.  This document generalizes IKEv2 signature support to allow any signature method supported by PKIX and also adds signature hash algorithm negotiation.  This is a generic mechanism and is not limited to ECDSA; it can also be used with other signature algorithms.</t></abstract>
</front>
<seriesInfo name='RFC' value='7427'/>
<seriesInfo name='DOI' value='10.17487/RFC7427'/>
</reference>



<reference  anchor="RFC8441" target='https://www.rfc-editor.org/info/rfc8441'>
<front>
<title>Bootstrapping WebSockets with HTTP/2</title>
<author initials='P.' surname='McManus' fullname='P. McManus'><organization /></author>
<date year='2018' month='September' />
<abstract><t>This document defines a mechanism for running the WebSocket Protocol (RFC 6455) over a single stream of an HTTP/2 connection.</t></abstract>
</front>
<seriesInfo name='RFC' value='8441'/>
<seriesInfo name='DOI' value='10.17487/RFC8441'/>
</reference>



<reference  anchor="RFC8471" target='https://www.rfc-editor.org/info/rfc8471'>
<front>
<title>The Token Binding Protocol Version 1.0</title>
<author initials='A.' surname='Popov' fullname='A. Popov' role='editor'><organization /></author>
<author initials='M.' surname='Nystroem' fullname='M. Nystroem'><organization /></author>
<author initials='D.' surname='Balfanz' fullname='D. Balfanz'><organization /></author>
<author initials='J.' surname='Hodges' fullname='J. Hodges'><organization /></author>
<date year='2018' month='October' />
<abstract><t>This document specifies version 1.0 of the Token Binding protocol. The Token Binding protocol allows client/server applications to create long-lived, uniquely identifiable TLS bindings spanning multiple TLS sessions and connections.  Applications are then enabled to cryptographically bind security tokens to the TLS layer, preventing token export and replay attacks.  To protect privacy, the Token Binding identifiers are only conveyed over TLS and can be reset by the user at any time.</t></abstract>
</front>
<seriesInfo name='RFC' value='8471'/>
<seriesInfo name='DOI' value='10.17487/RFC8471'/>
</reference>



<reference anchor="I-D.ietf-httpbis-http2-secondary-certs">
<front>
<title>Secondary Certificate Authentication in HTTP/2</title>

<author initials='M' surname='Bishop' fullname='Mike Bishop'>
    <organization />
</author>

<author initials='N' surname='Sullivan' fullname='Nick Sullivan'>
    <organization />
</author>

<author initials='M' surname='Thomson' fullname='Martin Thomson'>
    <organization />
</author>

<date month='October' day='23' year='2018' />

<abstract><t>A use of TLS Exported Authenticators is described which enables HTTP/2 clients and servers to offer additional certificate-based credentials after the connection is established.  The means by which these credentials are used with requests is defined.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-httpbis-http2-secondary-certs-03' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-httpbis-http2-secondary-certs-03.txt' />
</reference>



<reference anchor="I-D.pardue-httpbis-http-network-tunnelling">
<front>
<title>HTTP-initiated Network Tunnelling (HiNT)</title>

<author initials='L' surname='Pardue' fullname='Lucas Pardue'>
    <organization />
</author>

<date month='October' day='18' year='2018' />

<abstract><t>The HTTP CONNECT method allows an HTTP client to initiate, via a proxy, a TCP-based tunnel to a single destination origin.  This memo explores options for expanding HTTP-initiated Network Tunnelling (HiNT) to cater for diverse UDP and IP associations.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-pardue-httpbis-http-network-tunnelling-01' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-pardue-httpbis-http-network-tunnelling-01.txt' />
</reference>



<reference anchor="I-D.schwartz-httpbis-helium">
<front>
<title>Hybrid Encapsulation Layer for IP and UDP Messages (HELIUM)</title>

<author initials='B' surname='Schwartz' fullname='Benjamin Schwartz'>
    <organization />
</author>

<date month='June' day='25' year='2018' />

<abstract><t>HELIUM is a protocol that can be used to implement a UDP proxy, a VPN, or a hybrid of these.  It is intended to run over a reliable, secure substrate transport.  It can serve a variety of use cases, but its initial purpose is to enable HTTP proxies to forward non-TCP flows.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-schwartz-httpbis-helium-00' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-schwartz-httpbis-helium-00.txt' />
</reference>



<reference anchor="I-D.sullivan-tls-post-handshake-auth">
<front>
<title>Post-Handshake Authentication in TLS</title>

<author initials='N' surname='Sullivan' fullname='Nick Sullivan'>
    <organization />
</author>

<author initials='M' surname='Thomson' fullname='Martin Thomson'>
    <organization />
</author>

<author initials='M' surname='Bishop' fullname='Mike Bishop'>
    <organization />
</author>

<date month='August' day='5' year='2016' />

<abstract><t>This document describes a mechanism for performing post-handshake certificate-based authentication in Transport Layer Security (TLS) versions 1.3 and later.  This includes both spontaneous and solicited authentication of both client and server.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-sullivan-tls-post-handshake-auth-00' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-sullivan-tls-post-handshake-auth-00.txt' />
</reference>




    </references>


<section numbered="false" anchor="acknowledgments" title="Acknowledgments">

<t>This proposal was inspired directly or indirectly by prior work from many
people. In particular, this work is related to
<xref target="I-D.schwartz-httpbis-helium"/> and
<xref target="I-D.pardue-httpbis-http-network-tunnelling"/>. The mechanism used to
run the MASQUE protocol over HTTP/2 streams was inspired by <xref target="RFC8441"/>.
Using the OID for the signature algorithm was inspired by Signature
Authentication in IKEv2 <xref target="RFC7427"/>.</t>

<t>The author would like to thank Christophe A., an inspiration and true leader
of VPNs.</t>

</section>
<section numbered="false" anchor="design-justifications" title="Design Justifications">

<t>Using an exported key as a nonce allows us to prevent replay attacks (since it
depends on randomness from both endpoints of the TLS connection) without
requiring the server to send an explicit nonce before it has authenticated the
client. Adding an explicit nonce mechanism would expose the server as it would
need to send these nonces to clients that have not been authenticated yet.</t>

<t>The rationale for a separate MASQUE protocol stream is to allow
server-initiated messages. If we were to use HTTP semantics, we would only be
able to support the client-initiated request-response model. We could have used
WebSocket for this purpose but that would have added wire overhead and
dependencies without providing useful features.</t>

<t>There are many other ways to authenticate HTTP, however the authentication
used here needs to work in a single client-initiated message to meet the
requirement of not exposing the server.</t>

<t>The current proposal would also work with TLS 1.2, but in that case TLS false
start and renegotiation must be disabled, and the extended master secret and
renegotiation indication TLS extensions must be enabled.</t>

<t>If the server or client want to hide that HTTP/2 is used, the client can set
its ALPN to an older version of HTTP and then use the Upgrade header to
upgrade to HTTP/2 inside the TLS encryption.</t>

<t>The client authentication used here is similar to how Token Binding <xref target="RFC8471"/>
operates, but it has very different goals. MASQUE does not use token binding
directly because using token binding requires sending the token_binding TLS
extension in the TLS ClientHello, and that would stick out compared to a
regular TLS connection.</t>

<t>TLS post-handshake authentication <xref target="I-D.sullivan-tls-post-handshake-auth"/>
is not used by this proposal because that requires sending the
“post_handshake_auth” extension in the TLS ClientHello, and that would stick
out from a regular HTTPS connection.</t>

<t>Client authentication could have benefited from Secondary Certificate
Authentication in HTTP/2 <xref target="I-D.ietf-httpbis-http2-secondary-certs"/>,
however that has two downsides: it requires the server advertising that
it supports it in its SETTINGS, and it cannot be sent unprompted by the
client, so the server would have to request authentication.
Both of these would make the server stick out from regular HTTP/2 servers.</t>

<t>MASQUE proposes a new client authentication method (as opposed to reusing
something like HTTP basic authentication) because HTTP authentication methods
are conceptually per-request (they need to be repeated on each request)
whereas the new method is bound to the underlying connection (be it QUIC or
TLS). In particular, this allows sending QUIC DATAGRAM frames without
authenticating every frame individually. Additionally, HMAC and asymmetric
keying are preferred to sending a password for client authentication since
they have a tighter security bound. Going into the design rationale, HMACs
(and signatures) need some data to sign, and to avoid replay attacks that
should be a fresh nonce provided by the remote peer. Having the server
provide an explicit nonce would leak the existence of the server so we use
TLS keying material exporters as they provide us with a nonce that contains
entropy from the server without requiring explicit communication.</t>

</section>


  </back>

<!-- ##markdown-source:
H4sIAEdjeFwAA+1bbXMbN5L+jl+Boj+sfSXSkizHifa8dbSkWNy1XqKXOOer
qxTIAUmshgPuYEY07VJ++z3dDcwMKTmXuqr7llSqTHIwQKNfnn66AfX7fVW5
KreH+mZu9dnw+qfbE31Z+spPfK7MeFza+8P4u8r8pDALjM1KM636YTJ3hfni
+gsT/lVbNTGVnflyfajt56VSblke6qqsQ7W/u/vD7r66s+uVL7NDPSoqWxa2
6h/TPEqFyhTZryb3BeZe26CW7lD/F0TY0cGXVWmnAZ/WC/rw30qZupr78lDp
v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