<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.5 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-tls-keylogfile-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.19.1 -->
  <front>
    <title abbrev="SSLKEYLOGFILE">The SSLKEYLOGFILE Format for TLS</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-tls-keylogfile-00"/>
    <author fullname="Martin Thomson">
      <organization>Mozilla</organization>
      <address>
        <email>mt@lowentropy.net</email>
      </address>
    </author>
    <date year="2024" month="January" day="25"/>
    <area>Security</area>
    <workgroup>Transport Layer Security</workgroup>
    <keyword>network transparency</keyword>
    <keyword>tls</keyword>
    <keyword>blockchain</keyword>
    <abstract>
      <?line 37?>

<t>A format that supports the logging information about the secrets used in a TLS
connection is described.  Recording secrets to a file in SSLKEYLOGFILE format
allows diagnostic and logging tools that use this file to decrypt messages
exchanged by TLS endpoints.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://tlswg.github.io/sslkeylogfile/draft-ietf-tls-keylogfile.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-tls-keylogfile/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Transport Layer Security Working Group mailing list (<eref target="mailto:tls@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/tls/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/tls/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/tlswg/sslkeylogfile"/>.</t>
    </note>
  </front>
  <middle>
    <?line 45?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>Debugging or analyzing protocols can be challenging when TLS <xref target="TLS13"/> is used
to protect the content of communications.  Inspecting the content of encrypted
messages in diagnostic tools can enable more thorough analysis.</t>
      <t>Over time, multiple TLS implementations have informally adopted a file format
that logging the secret values generated by the TLS key schedule.  In many
implementations, the file that the secrets are logged to is specified in an
environment variable named "SSLKEYLOGFILE", hence the name of SSLKEYLOGFILE
format.  Note the use of "SSL" as this convention originally predates the
adoption of TLS as the name of the protocol.</t>
      <t>This document describes the SSLKEYLOGFILE format.  This format can be used for
TLS 1.2 <xref target="TLS12"/> and TLS 1.3 <xref target="TLS13"/>.  The format also
supports earlier TLS versions, though use of earlier versions is forbidden
<xref target="RFC8996"/>.  This format can also be used with DTLS <xref target="DTLS13"/>, QUIC
<xref target="RFC9000"/><xref target="RFC9001"/>, and other protocols that also use the TLS key
schedule.  Use of this format could complement other protocol-specific logging
such as QLOG <xref target="QLOG"/>.</t>
      <section anchor="applicability-statement">
        <name>Applicability Statement</name>
        <t>The artifact that this document describes - if made available to entities other
than endpoints - completely undermines the core guarantees that TLS provides.
This format is intended for use in systems where TLS only protects test data.
While the access that this information provides to TLS connections can be useful
for diagnosing problems while developing systems, this mechanism <bcp14>MUST NOT</bcp14> be
used in a production system.</t>
      </section>
      <section anchor="conventions-and-definitions">
        <name>Conventions and Definitions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" 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>
        <?line -18?>

</section>
    </section>
    <section anchor="the-sslkeylogfile-format">
      <name>The SSLKEYLOGFILE Format</name>
      <t>A file in SSLKEYLOGFILE format is a text file.  This document specifies the
character encoding as UTF-8 <xref target="RFC3629"/>.  Though the format itself only
includes ASCII characters <xref target="RFC0020"/>, comments <bcp14>MAY</bcp14> contain other characters.
Though Unicode is permitted in comments, the file <bcp14>MUST NOT</bcp14> contain a unicode
byte order mark (U+FEFF).</t>
      <t>Lines are terminated using the line ending convention of the platform on which
the file is generated.  Tools that process these files <bcp14>MUST</bcp14> accept CRLF (U+13
followed by U+10), CR (U+13), or LF (U+10) as a line terminator.  Lines are
ignored if they are empty or if the first character is an octothorp character
('#', U+23).  Other lines of the file each contain a single secret.</t>
      <t>Implementations that record secrets to a file do so continuously as those
secrets are generated.</t>
      <t>Each secret is described using a single line composed of three values that are
separated by a single space character (U+20).  These values are:</t>
      <dl>
        <dt>label:</dt>
        <dd>
          <t>The label identifies the type of secret that is being conveyed; see <xref target="labels"/>
for a description of the labels that are defined in this document.</t>
        </dd>
        <dt>client_random:</dt>
        <dd>
          <t>The 32 byte value of the Random field from the ClientHello message that
established the TLS connection.  This value is encoded as 64 hexadecimal
characters.  Including this field allows a single file to include secrets from
multiple connections and for the secrets to be applied to the correct
connection, though this depends on being able to match records to the correct
ClientHello message.</t>
        </dd>
        <dt>secret:</dt>
        <dd>
          <t>The value of the identified secret for the identified connection.  This value
is encoded in hexadecimal, with a length that depends on the size of the
secret.</t>
        </dd>
      </dl>
      <t>For the hexadecimal values of the <tt>client_random</tt> or <tt>secret</tt>, no convention
exists for the case of characters 'a' through 'f' (or 'A' through 'F').  Files
can be generated with either, so either form <bcp14>MUST</bcp14> be accepted when processing a
file.</t>
      <t>Diagnostic tools that accept files in this format might choose to ignore lines
that do not conform to this format in the interest of ensuring that secrets can
be obtained from corrupted files.</t>
      <t>Logged secret values are not annotated with the ciphersuite or other connection
parameters.  A record of the TLS handshake might therefore be needed to use the
logged secrets.</t>
      <section anchor="labels">
        <name>Secret Labels for TLS 1.3</name>
        <t>An implementation of TLS 1.3 produces a number of values as part of the key
schedule (see <xref section="7.1" sectionFormat="of" target="TLS13"/>).  Each of the following labels
correspond to the equivalent secret produced by the key schedule:</t>
        <dl newline="true">
          <dt>CLIENT_EARLY_TRAFFIC_SECRET:</dt>
          <dd>
            <t>This secret is used to protect records sent by the client as early data, if
early data is attempted by the client.  Note that a server that rejects early
data will not log this secret, though a client that attempts early data can do
so unconditionally.</t>
          </dd>
          <dt>EARLY_EXPORTER_MASTER_SECRET:</dt>
          <dd>
            <t>This secret is used for early exporters.  Like the
CLIENT_EARLY_TRAFFIC_SECRET, this is only generated when early data is
attempted and might not be logged by a server if early data is rejected.</t>
          </dd>
          <dt>CLIENT_HANDSHAKE_TRAFFIC_SECRET:</dt>
          <dd>
            <t>This secret is used to protect handshake records sent by the client.</t>
          </dd>
          <dt>SERVER_HANDSHAKE_TRAFFIC_SECRET:</dt>
          <dd>
            <t>This secret is used to protect handshake records sent by the server.</t>
          </dd>
          <dt>CLIENT_TRAFFIC_SECRET_0:</dt>
          <dd>
            <t>This secret is used to protect application_data records sent by the client
immediately after the handshake completes.  This secret is identified as
<tt>client_application_traffic_secret_0</tt> in the TLS 1.3 key schedule.</t>
          </dd>
          <dt>SERVER_TRAFFIC_SECRET_0:</dt>
          <dd>
            <t>This secret is used to protect application_data records sent by the server
immediately after the handshake completes.  This secret is identified as
<tt>server_application_traffic_secret_0</tt> in the TLS 1.3 key schedule.</t>
          </dd>
          <dt>EXPORTER_SECRET:</dt>
          <dd>
            <t>This secret is used in generating exporters <xref section="7.5" sectionFormat="of" target="TLS13"/>.</t>
          </dd>
        </dl>
        <t>These labels all appear in uppercase in the key log, but they correspond to
lowercase labels in the TLS key schedule (<xref section="7.1" sectionFormat="of" target="TLS13"/>), except for
the application data secrets as noted.  For example, "EXPORTER_SECRET" in the
log file corresponds to the secret named <tt>exporter_secret</tt>.</t>
        <t>Note that the order that labels appear here corresponds to the order in which
they are presented in <xref target="TLS13"/>, but there is no guarantee that implementations
will log secrets strictly in this order.</t>
        <t>Key updates (<xref section="7.2" sectionFormat="of" target="TLS13"/>) result in new secrets being generated
for protecting <tt>application_data</tt> records.  The label used for these secrets
comprises a base label of "CLIENT_TRAFFIC_SECRET_" for a client or
"SERVER_TRAFFIC_SECRET_" for a server, plus the decimal value of a counter.
This counter identifies the number of key updates that occurred to produce this
secret.  This counter starts at 0, which produces the first application data
traffic secret, as above.</t>
      </section>
      <section anchor="secret-labels-for-tls-12">
        <name>Secret Labels for TLS 1.2</name>
        <t>An implementation of TLS 1.2 <xref target="TLS12"/> (and also earlier versions) use the
label "CLIENT_RANDOM" to identify the "master" secret for the connection.</t>
      </section>
    </section>
    <section anchor="security">
      <name>Security Considerations</name>
      <t>Access to the content of a file in SSLKEYLOGFILE format allows an attacker to
break the confidentiality protection on any TLS connections that are included in
the file.  This includes both active connections and connections for which
encrypted records were previously stored.  Ensuring adequate access control on
these files therefore becomes very important.</t>
      <t>Implementations that support logging this data need to ensure that logging can
only be enabled by those who are authorized.  Allowing logging to be initiated
by any entity that is not otherwise authorized to observe or modify the content
of connections for which secrets are logged could represent a privilege
escalation attack.  Implementations that enable logging also need to ensure that
access to logged secrets is limited, using appropriate file permissions or
equivalent access control mechanisms.</t>
      <t>In order to support decryption, the secrets necessary to remove record
protection are logged.  However, as the keys that can be derived from these
secrets are symmetric, an adversary with access to these secrets is also able to
encrypt data for an active connection.  This might allow for injection or
modification of application data on a connection that would otherwise be
protected by TLS.</t>
      <t>As some protocols rely on TLS for generating encryption keys, the SSLKEYLOGFILE
format includes keys that identify the secret used in TLS exporters or early
exporters (<xref section="7.5" sectionFormat="of" target="TLS13"/>.  Knowledge of these secrets can enable
more than inspection or modification of encrypted data, depending on how an
application protocol uses exporters.  For instance, exporters might be used for
session bindings (e.g., <xref target="RFC8471"/>), authentication (e.g., <xref target="RFC9261"/>), or
other derived secrets that are used in application context.  An adversary that
obtains these secrets might be able to use this information to attack these
applications.  A TLS implementation might either choose to omit these secrets in
contexts where the information might be abused or require separate
authorization to enable logging of exporter secrets.</t>
      <t>Using an environment variable, such as <tt>SSLKEYLOGFILE</tt>, to enable logging
implies that access to the launch context for the application is needed to
authorize logging.  On systems that support specially-named files, logs might be
directed to these names so that logging does not result in storage, but enable
consumption by other programs.  In both cases, applications might require
special autorization or they might rely on system-level access control to limit
access to these capabilities.</t>
      <t>Logging the TLS 1.2 "master" secret provides the recipient of that secret far
greater access to an active connection than TLS 1.3 secrets.  In addition to
reading and altering protected mesages, the TLS 1.2 "master" secret confers the
ability to resume the connection and impersonate either endpoint, insert records
that result in renegotiation, and forge Finished messages.  Implementations can
avoid the risks associated with these capabilities by not logging this secret
value.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>The "<tt>application/sslkeylogfile</tt>" media type can be used to describe content in
the SSLKEYLOGFILE format.  IANA [has added/is requested to add] the following
information to the "Media Types" registry at
<eref target="https://www.iana.org/assignments/media-types">https://www.iana.org/assignments/media-types</eref>:</t>
      <dl spacing="compact">
        <dt>Type name:</dt>
        <dd>
          <t>application</t>
        </dd>
        <dt>Subtype name:</dt>
        <dd>
          <t>sslkeylogfile</t>
        </dd>
        <dt>Required parameters:</dt>
        <dd>
          <t>N/A</t>
        </dd>
        <dt>Optional parameters:</dt>
        <dd>
          <t>N/A</t>
        </dd>
        <dt>Encoding considerations:</dt>
        <dd>
          <t>8bit (Unicode without BOM or ASCII only)</t>
        </dd>
        <dt>Security considerations:</dt>
        <dd>
          <t>See <xref target="security"/>.</t>
        </dd>
        <dt>Interoperability considerations:</dt>
        <dd>
          <t>Line endings might differ from platform convention</t>
        </dd>
        <dt>Published specification:</dt>
        <dd>
          <t>This document</t>
        </dd>
        <dt>Applications that use this media type:</dt>
        <dd>
          <t>Diagnostic and analysis tools that need to decrypt data that is otherwise
protected by TLS.</t>
        </dd>
        <dt>Fragment identifier considerations:</dt>
        <dd>
          <t>N/A</t>
        </dd>
        <dt>Additional information:</dt>
        <dd>
          <dl spacing="compact">
            <dt>Deprecated alias names for this type:</dt>
            <dd>N/A</dd>
            <dt>Magic number(s):</dt>
            <dd>N/A</dd>
            <dt>File extension(s):</dt>
            <dd>N/A</dd>
            <dt>Macintosh file type code(s):</dt>
            <dd>N/A</dd>
          </dl>
        </dd>
        <dt>Person &amp; email address to contact for further information:</dt>
        <dd>
          <t>See the Authors' Addresses section.</t>
        </dd>
        <dt>Intended usage:</dt>
        <dd>
          <t>COMMON</t>
        </dd>
        <dt>Restrictions on usage:</dt>
        <dd>
          <t>N/A</t>
        </dd>
        <dt>Author:</dt>
        <dd>
          <t>See the Authors' Addresses section.</t>
        </dd>
        <dt>Change controller:</dt>
        <dd>
          <t>IESG</t>
        </dd>
      </dl>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="TLS13">
          <front>
            <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
            <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
            <date month="August" year="2018"/>
            <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="TLS12">
          <front>
            <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
            <author fullname="T. Dierks" initials="T." surname="Dierks"/>
            <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
            <date month="August" year="2008"/>
            <abstract>
              <t>This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5246"/>
          <seriesInfo name="DOI" value="10.17487/RFC5246"/>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <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="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <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="RFC3629">
          <front>
            <title>UTF-8, a transformation format of ISO 10646</title>
            <author fullname="F. Yergeau" initials="F." surname="Yergeau"/>
            <date month="November" year="2003"/>
            <abstract>
              <t>ISO/IEC 10646-1 defines a large character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. The originally proposed encodings of the UCS, however, were not compatible with many current applications and protocols, and this has led to the development of UTF-8, the object of this memo. UTF-8 has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values. This memo obsoletes and replaces RFC 2279.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="63"/>
          <seriesInfo name="RFC" value="3629"/>
          <seriesInfo name="DOI" value="10.17487/RFC3629"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="RFC8996">
          <front>
            <title>Deprecating TLS 1.0 and TLS 1.1</title>
            <author fullname="K. Moriarty" initials="K." surname="Moriarty"/>
            <author fullname="S. Farrell" initials="S." surname="Farrell"/>
            <date month="March" year="2021"/>
            <abstract>
              <t>This document formally deprecates Transport Layer Security (TLS) versions 1.0 (RFC 2246) and 1.1 (RFC 4346). Accordingly, those documents have been moved to Historic status. These versions lack support for current and recommended cryptographic algorithms and mechanisms, and various government and industry profiles of applications using TLS now mandate avoiding these old TLS versions. TLS version 1.2 became the recommended version for IETF protocols in 2008 (subsequently being obsoleted by TLS version 1.3 in 2018), providing sufficient time to transition away from older versions. Removing support for older versions from implementations reduces the attack surface, reduces opportunity for misconfiguration, and streamlines library and product maintenance.</t>
              <t>This document also deprecates Datagram TLS (DTLS) version 1.0 (RFC 4347) but not DTLS version 1.2, and there is no DTLS version 1.1.</t>
              <t>This document updates many RFCs that normatively refer to TLS version 1.0 or TLS version 1.1, as described herein. This document also updates the best practices for TLS usage in RFC 7525; hence, it is part of BCP 195.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="195"/>
          <seriesInfo name="RFC" value="8996"/>
          <seriesInfo name="DOI" value="10.17487/RFC8996"/>
        </reference>
        <reference anchor="DTLS13">
          <front>
            <title>The Datagram Transport Layer Security (DTLS) Protocol Version 1.3</title>
            <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
            <author fullname="H. Tschofenig" initials="H." surname="Tschofenig"/>
            <author fullname="N. Modadugu" initials="N." surname="Modadugu"/>
            <date month="April" year="2022"/>
            <abstract>
              <t>This document specifies version 1.3 of the Datagram Transport Layer Security (DTLS) protocol. DTLS 1.3 allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t>
              <t>The DTLS 1.3 protocol is based on the Transport Layer Security (TLS) 1.3 protocol and provides equivalent security guarantees with the exception of order protection / non-replayability. Datagram semantics of the underlying transport are preserved by the DTLS protocol.</t>
              <t>This document obsoletes RFC 6347.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9147"/>
          <seriesInfo name="DOI" value="10.17487/RFC9147"/>
        </reference>
        <reference anchor="RFC9000">
          <front>
            <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
            <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
            <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
            <date month="May" year="2021"/>
            <abstract>
              <t>This document defines the core of the QUIC transport protocol. QUIC provides applications with flow-controlled streams for structured communication, low-latency connection establishment, and network path migration. QUIC includes security measures that ensure confidentiality, integrity, and availability in a range of deployment circumstances. Accompanying documents describe the integration of TLS for key negotiation, loss detection, and an exemplary congestion control algorithm.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9000"/>
          <seriesInfo name="DOI" value="10.17487/RFC9000"/>
        </reference>
        <reference anchor="RFC9001">
          <front>
            <title>Using TLS to Secure QUIC</title>
            <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
            <author fullname="S. Turner" initials="S." role="editor" surname="Turner"/>
            <date month="May" year="2021"/>
            <abstract>
              <t>This document describes how Transport Layer Security (TLS) is used to secure QUIC.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9001"/>
          <seriesInfo name="DOI" value="10.17487/RFC9001"/>
        </reference>
        <reference anchor="QLOG">
          <front>
            <title>Main logging schema for qlog</title>
            <author fullname="Robin Marx" initials="R." surname="Marx">
              <organization>Akamai</organization>
            </author>
            <author fullname="Luca Niccolini" initials="L." surname="Niccolini">
              <organization>Meta</organization>
            </author>
            <author fullname="Marten Seemann" initials="M." surname="Seemann">
              <organization>Protocol Labs</organization>
            </author>
            <author fullname="Lucas Pardue" initials="L." surname="Pardue">
              <organization>Cloudflare</organization>
            </author>
            <date day="23" month="October" year="2023"/>
            <abstract>
              <t>   This document defines qlog, an extensible high-level schema for a
   standardized logging format.  It allows easy sharing of data,
   benefitting common debug and analysis methods and tooling.  The high-
   level schema is independent of protocol; separate documents extend
   qlog for protocol-specific data.  The schema is also independent of
   serialization format, allowing logs to be represented in many ways
   such as JSON, CSV, or protobuf.

Note to Readers

      Note to RFC editor: Please remove this section before publication.

   Feedback and discussion are welcome at https://github.com/quicwg/qlog
   (https://github.com/quicwg/qlog).  Readers are advised to refer to
   the "editor's draft" at that URL for an up-to-date version of this
   document.

   Concrete examples of integrations of this schema in various
   programming languages can be found at https://github.com/quiclog/
   qlog/ (https://github.com/quiclog/qlog/).

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-quic-qlog-main-schema-07"/>
        </reference>
        <reference anchor="RFC0020">
          <front>
            <title>ASCII format for network interchange</title>
            <author fullname="V.G. Cerf" initials="V.G." surname="Cerf"/>
            <date month="October" year="1969"/>
          </front>
          <seriesInfo name="STD" value="80"/>
          <seriesInfo name="RFC" value="20"/>
          <seriesInfo name="DOI" value="10.17487/RFC0020"/>
        </reference>
        <reference anchor="RFC8471">
          <front>
            <title>The Token Binding Protocol Version 1.0</title>
            <author fullname="A. Popov" initials="A." role="editor" surname="Popov"/>
            <author fullname="M. Nystroem" initials="M." surname="Nystroem"/>
            <author fullname="D. Balfanz" initials="D." surname="Balfanz"/>
            <author fullname="J. Hodges" initials="J." surname="Hodges"/>
            <date month="October" year="2018"/>
            <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="RFC9261">
          <front>
            <title>Exported Authenticators in TLS</title>
            <author fullname="N. Sullivan" initials="N." surname="Sullivan"/>
            <date month="July" year="2022"/>
            <abstract>
              <t>This document describes a mechanism that builds on Transport Layer Security (TLS) or Datagram Transport Layer Security (DTLS) and enables peers to provide proof of ownership of an identity, such as an X.509 certificate. This proof can be exported by one peer, transmitted out of band to the other peer, and verified by the receiving peer.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9261"/>
          <seriesInfo name="DOI" value="10.17487/RFC9261"/>
        </reference>
      </references>
    </references>
    <?line 355?>

<section anchor="example">
      <name>Example</name>
      <t>The following is a sample of a file in this format, including secrets from a TLS
1.3 connection.</t>
      <artwork><![CDATA[
# NOTE: '\' line wrapping per RFC 8792

CLIENT_HANDSHAKE_TRAFFIC_SECRET \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  be4a28d81ce41242ff31c6d8a6615852178f2cd75eaca2ee8768f9ed51282b38
SERVER_HANDSHAKE_TRAFFIC_SECRET \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  258179721fa704e2f1ee16688b4b0419967ddea5624cd5ad0863288dc5ead35f
CLIENT_TRAFFIC_SECRET_0 \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  e9ca165bcb762fab8086068929d26c532e90ef2e2daa762d8b52346951a34c02
SERVER_TRAFFIC_SECRET_0 \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  4f93c61ac1393008d4c820f3723db3c67494f06574b65fcc21c9eef22f90071a
EXPORTER_SECRET \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  011c900833468f837f7c55d836b2719beebd39b1648fdeda58772f48d94a1ffa
]]></artwork>
      <t>The following shows a log entry for a TLS 1.2 connection.</t>
      <artwork><![CDATA[
# NOTE: '\' line wrapping per RFC 8792

CLIENT_RANDOM \
  ad52329fcadd34ee3aa07092680287f09954823e26d7b5ae25c0d47714152a6a \
  97af4c8618cfdc0b2326e590114c2ec04b43b08b7e2c3f8124cc61a3b068ba966\
  9517e744e3117c3ce6c538a2d88dfdf
]]></artwork>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>The SSLKEYLOGFILE format originated in the NSS project, but it has evolved over
time as TLS has changed.  Many people contributed to this evolution.  The author
is only documenting the format as it is used.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA7Vb+XLbRpr/v5+ih65a2bukRIK31nGGoyNWRUdGknc2NZmy
GkCDxBgEGDQomUkpz7LPsk+239HdACnJntrJ/GOBQB/f+fuObnc6HVGlVaYP
Zet2oeXNzfn3Jz+eX313enZ+Ik+LcqkqmRSlvD2/aQkVhqW+h6Fbw1oiUpWe
F+XmUKZ5UggRF1GulrBmXKqk6qS6SjpVZjqf9CYr5kma6U63K8w6XKbGpEVe
bVYw+Ozk9lTk62Woy0MRw5KHIipyo3OzNoeyKtdawN59oUqtkAYdrcu02rTE
Q1F+mpfFeoVMlCo3q6Ks5Lna6FLWo2BzGBgfCtmRua5wEiyKo2HBPNrgeyAS
/4RZEX2KFirNxb3O10CIlF/fQErmo/UXWDrN5/I7nILvlyrN4D2s/keUxX5R
zvG1KqMFvF5U1cocHhzgKHyV3ut9N+wAXxyEZfFg9AHMP8B587RarENe8GF+
YExWCxa/ZyA7UzVWpnH7PG0/LbZnHLyopP1FtcxaQqh1tShKFBwsLmWyzjJW
74UqqzSXt4tiaYqcPgLNKk9/URWoFQYUv6RZpuiLZiksqz9mxYPOq7JYbfZB
EULkZGbA9qEQaED1L9HpdKQKDegpgoEzyR9ltYB/zHqFejDwS0sgeY4y9/OL
HCYW64q+Gh2VGkaujY5hiFRoz2hduY5oaGpkrE1UpqGO96W81hGYCq7nZlYF
TEKh4PRtL+ENhcqAL1gmVfO8MFUaSZXHnq6qKDLDdAMR8AA70nKwcAx7bFaV
XGpj1FwboT+D8eVzoDXcIKVS5/GqSPPK7FuZL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