<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-tls-keylogfile-05" number="9850" updates="" obsoletes="" xml:lang="en" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">

  <front>
    <title abbrev="SSLKEYLOGFILE">The SSLKEYLOGFILE Format for TLS</title>
    <seriesInfo name="RFC" value="9850"/>
    <author fullname="Martin Thomson">
      <organization>Mozilla</organization>
      <address>
        <email>mt@lowentropy.net</email>
      </address>
    </author>
    <author fullname="Yaroslav Rosomakho">
      <organization>Zscaler</organization>
      <address>
        <email>yrosomakho@zscaler.com</email>
      </address>
    </author>
    <author fullname="Hannes Tschofenig">
      <organization abbrev="H-BRS">University of Applied Sciences Bonn-Rhein-Sieg</organization>
      <address>
        <email>Hannes.Tschofenig@gmx.net</email>
      </address>
    </author>
    <date year="2025" month="December"/>
    <area>SEC</area>
    <workgroup>tls</workgroup>
    <keyword>network transparency</keyword>
    <keyword>tls</keyword>
    <keyword>blockchain</keyword>
    <abstract>
<t>This document describes a format that supports logging information about the secrets used in a TLS
connection.  Recording secrets to a file in SSLKEYLOGFILE format
allows diagnostic and logging tools that use this file to decrypt messages
exchanged by TLS endpoints.  This format is intended for use in systems where
TLS only protects test data.</t>
    </abstract>

  </front>
  <middle>

    <section anchor="introduction">
      <name>Introduction</name>
      <t>Debugging or analyzing protocols can be challenging when TLS <xref target="RFC9846"/> 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
for 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="RFC5246"/> and TLS 1.3 <xref target="RFC9846"/>.  The format also
supports earlier TLS versions, though use of earlier versions is strongly discouraged
<xref target="RFC8996"/> <xref target="RFC9325"/>.  This format can also be used with DTLS <xref target="RFC9147"/>, QUIC
<xref target="RFC9000"/> <xref target="RFC9001"/>, and other protocols that use the TLS key
schedule.  Use of this format could complement other protocol-specific logging
such as qlog <xref target="I-D.ietf-quic-qlog-main-schema"/>.</t>
      <t>This document also defines labels that can be used to log information
about exchanges that use Encrypted Client Hello (ECH) <xref target="RFC9849"/>.</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.  For software that is compiled, use of conditional
compilation is the best way to ensure that deployed binaries cannot be
configured to enable key logging.</t>
        <t><xref target="security"/> addresses a number of additional concerns that arise from the use
of key logging.</t>
      </section>
      <section anchor="conventions-and-definitions">
        <name>Conventions</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&nbsp;14 <xref target="RFC2119"/>
    <xref target="RFC8174"/> when, and only when, they appear in all capitals,
    as shown here. 
</t>
      </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 octothorpe 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 spacing="normal" newline="true">
        <dt><tt>label</tt>:</dt>
        <dd>
          <t>The <tt>label</tt> identifies the type of secret that is being conveyed; see Sections <xref target="labels" format="counter"/>, <xref target="secret-labels-for-tls-12" format="counter"/>, and <xref target="secret-labels-for-ech" format="counter"/>
for descriptions of the labels that are defined in this document.</t>
        </dd>
        <dt><tt>client_random</tt>:</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.  In a log that can include secrets from multiple connections, this
field can be used to identify a connection.</t>
        </dd>
        <dt><tt>secret</tt>:</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 <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 cipher suite or other connection
parameters.  Therefore, a record of the TLS handshake might 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="RFC9846"/>). If ECH was successfully negotiated for a
given connection, these labels <bcp14>MUST</bcp14> be followed by the value of the Random field from the Inner ClientHello.
Otherwise, the Random field from the Outer ClientHello <bcp14>MUST</bcp14> be used.</t>

<t>Each of the following labels correspond to the equivalent secret produced by the key schedule:</t>
        <dl spacing="normal" 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_SECRET:</dt>
          <dd>
            <t>This secret is used for early exporters.  Like
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="RFC9846"/>).</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="RFC9846"/>), 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="RFC9846"/>, but there is no guarantee that implementations
will log secrets strictly in this order.</t>
      </section>
      <section anchor="secret-labels-for-tls-12">
        <name>Secret Labels for TLS 1.2</name>
        <t>Implementations of TLS 1.2 <xref target="RFC5246"/> (and also earlier versions) use the
label "CLIENT_RANDOM" to identify the "master" secret for the connection.</t>
      </section>
      <section anchor="secret-labels-for-ech">
        <name>Secret Labels for ECH</name>
        <t>With ECH <xref target="RFC9849"/>, additional secrets are derived
during the handshake to encrypt the Inner ClientHello message using Hybrid Public
Key Encryption (HPKE) <xref target="RFC9180"/>. A client can log the ECH labels described below
if it offered ECH, regardless of server acceptance. The server can log the labels only if it
successfully decrypted the ECH offered by the client, though it could choose to do so
only when it accepts ECH.</t>
        <t>These labels <bcp14>MUST</bcp14> always use the Random from the Outer ClientHello.</t>
        <dl spacing="normal" newline="true">
          <dt>ECH_SECRET:</dt>
          <dd>
            <t>This label corresponds to the Key Encapsulation Mechanism (KEM) shared secret used by HPKE
(<tt>shared_secret</tt> in the algorithms in <xref section="5.1.1" sectionFormat="of" target="RFC9180"/>).
The length of the secret is defined by the KEM negotiated for use with ECH.</t>
          </dd>
          <dt>ECH_CONFIG:</dt>
          <dd>
            <t>The ECHConfig used to construct the ECH extension. The value is logged
in hexadecimal representation.</t>
          </dd>
        </dl>
      </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 and integrity 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.  Therefore, ensuring adequate access
control on these files 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="RFC9846"/>).  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 enables
consumption by other programs.  In both cases, applications might require
special authorization or might rely on system-level access control to limit
      access to these capabilities.</t>
      <t>Forward secrecy guarantees provided in TLS 1.3 (see Section <xref target="RFC9846" section="1.3" sectionFormat="bare"/> and Appendix <xref target="RFC9846" section="F.1" sectionFormat="bare"/> of <xref target="RFC9846"/>) and some modes of TLS 1.2 (such as those in Sections <xref target="RFC8422" section="2.1" sectionFormat="bare"/> and <xref target="RFC8422" section="2.2" sectionFormat="bare"/> of <xref target="RFC8422"/>) do not hold if key material is recorded.  Access to key
material allows an attacker to decrypt data exchanged in any previously logged TLS
connections.</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 provide.  In addition to
reading and altering protected messages, 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>
      <t>Access to the ECH_SECRET record in SSLKEYLOGFILE allows the attacker to decrypt
the ECH extension and thereby reveal the content of the Inner ClientHello message,
including the payload of the Server Name Indication (SNI) extension.</t>
      <t>Access to the HPKE-established shared secret used in ECH introduces a potential
attack surface against the HPKE library since access to this keying material
is normally not available otherwise.</t>
</section>

<!-- IANA Considerations section

a) Section 4.1: FYI - We made a minor change (i.e., added a period) to the
media type template. If no objections, we will ask IANA to update the template
at https://www.iana.org/assignments/media-types/application/sslkeylogfile
accordingly prior to publication.


b) Section 4.2: Please review the suggestions below for the description of
EARLY_EXPORTER_SECRET and let us know which is preferred.

Note: If this is description updated, we will request that IANA update the
registry to match the edited document prior to publication. Link to registry:
https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-sslkeylogfile-labels

Original:
 Early exporters secret

Perhaps:
 Secret for early exporters

Or:
 Early exporter secret
-->

    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document registers a media type (<xref target="iana-media"/>)
and creates a registry for labels (<xref target="iana-labels-registry"/>).</t>
<section anchor="iana-media">
        <name>SSLKEYLOGFILE Media Type</name>
        <t>The "<tt>application/sslkeylogfile</tt>" media type can be used to describe content in
the SSLKEYLOGFILE format.  IANA has added the following
information to the "Media Types" registry at
<eref brackets="angle" target="https://www.iana.org/assignments/media-types"/>:</t>
        <dl spacing="normal" newline="false">
          <dt>Type name:</dt><dd>application</dd>
          <dt>Subtype name:</dt> <dd>sslkeylogfile</dd>
          <dt>Required parameters:</dt> <dd>N/A</dd>
          <dt>Optional parameters:</dt> <dd>N/A</dd>
          <dt>Encoding considerations:</dt> <dd>UTF-8 without BOM, or ASCII only</dd>
          <dt>Security considerations:</dt> <dd>See <xref target="security"/>.</dd>
          <dt>Interoperability considerations:</dt> <dd>Line endings might differ from platform convention.</dd>
          <dt>Published specification:</dt> <dd>RFC 9850</dd>
          <dt>Applications that use this media type:</dt> <dd>Diagnostic and
          analysis tools that need to decrypt data that is otherwise protected
          by TLS.</dd>
          <dt>Fragment identifier considerations:</dt> <dd>N/A</dd>
          <dt>Additional information:</dt>
          <dd><t><br/></t>
            <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><br/>TLS WG (tls@ietf.org)</dd>
          <dt>Intended usage:</dt>
          <dd>COMMON</dd>
          <dt>Restrictions on usage:</dt>
          <dd>N/A</dd>
          <dt>Author:</dt>
          <dd>IETF TLS Working Group</dd>
          <dt>Change controller:</dt>
          <dd>IETF</dd>
        </dl>
      </section>
      <section anchor="iana-labels-registry">
        <name>TLS SSLKEYLOGFILE Labels Registry</name>
        <t>IANA has created a new registry named "TLS SSLKEYLOGFILE Labels" within the
existing "Transport Layer Security (TLS) Parameters" registry group.
This new registry reserves labels used for SSLKEYLOGFILE entries.
The initial contents of this registry are as follows:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">CLIENT_RANDOM</td>
              <td align="left">Master secret in TLS 1.2 and earlier</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">CLIENT_EARLY_TRAFFIC_SECRET</td>
              <td align="left">Secret for client early data records</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">EARLY_EXPORTER_SECRET</td>
              <td align="left">Early exporter secret</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">CLIENT_HANDSHAKE_TRAFFIC_SECRET</td>
              <td align="left">Secret protecting client handshake</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">SERVER_HANDSHAKE_TRAFFIC_SECRET</td>
              <td align="left">Secret protecting server handshake</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">CLIENT_TRAFFIC_SECRET_0</td>
              <td align="left">Secret protecting client records post handshake</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">SERVER_TRAFFIC_SECRET_0</td>
              <td align="left">Secret protecting server records post handshake</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">EXPORTER_SECRET</td>
              <td align="left">Exporter secret after handshake</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">ECH_SECRET</td>
              <td align="left">HPKE KEM shared secret used in the ECH</td>
              <td align="left">RFC 9850</td>
            </tr>
            <tr>
              <td align="left">ECH_CONFIG</td>
              <td align="left">ECHConfig used for construction of the ECH</td>
              <td align="left">RFC 9850</td>
            </tr>
          </tbody>
        </table>

	
        <t>New assignments in the "TLS SSLKEYLOGFILE Labels" registry will be administered by IANA through
the Specification Required procedure <xref target="RFC8126"/>. The role of designated experts for TLS registries is described
in <xref section="17" sectionFormat="of" target="RFC8447"/>. Designated experts for this registry are advised to ensure that the specification is
publicly available.  In the Reference column, it is sufficient to cite an Internet-Draft (that is posted but not published
as an RFC) or a document from another standards body, an industry consortium, or any other organization.
Designated experts may provide more in-depth reviews, but their approval should not be taken as an endorsement
of the SSLKEYLOGFILE label.</t>
      </section>
    </section>
  </middle>
  <back>
    <displayreference target="RFC5246" to="TLS12"/>
    <displayreference target="RFC9147" to="DTLS13"/>
    <displayreference target="RFC9180" to="HPKE"/>
    <displayreference target="RFC9846" to="TLS13"/>
    <displayreference target="RFC9849" to="ECH"/>
    <displayreference target="I-D.ietf-quic-qlog-main-schema" to="QLOG"/>


    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>

<!-- [RFC9846 / TLS]
draft-ietf-tls-rfc8446bis-14
companion doc
in RFC-EDITOR as of 12/12/25
-->
<reference anchor="RFC9846" target="https://www.rfc-editor.org/info/rfc9846">
  <front>
    <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
    <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
      <organization>Independent</organization>
    </author>
    <date month='December' year='2025'/>
  </front>
  <seriesInfo name="RFC" value="9846"/>
  <seriesInfo name="DOI" value="10.17487/RFC9846"/>
</reference>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml"/>

<!-- [RFC9849 / ECH]
draft-ietf-tls-esni-25
companion doc
in AUTH48 as of 11/14/25
-->
<reference anchor="RFC9849" target="https://www.rfc-editor.org/info/rfc9849">
  <front>
    <title>TLS Encrypted Client Hello</title>
    <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
      <organization>Independent</organization>
    </author>
    <author initials="K." surname="Oku" fullname="Kazuho Oku">
      <organization>Fastly</organization>
    </author>
    <author initials="N." surname="Sullivan" fullname="Nick Sullivan">
      <organization>Cryptography Consulting LLC</organization>
    </author>
    <author initials="C. A." surname="Wood" fullname="Christopher A. Wood">
      <organization>Cloudflare</organization>
    </author>
    <date month='December' year='2025'/>
  </front>
  <seriesInfo name="RFC" value="9849"/>
  <seriesInfo name="DOI" value="10.17487/RFC9849"/>
</reference>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3629.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9180.xml"/>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8422.xml"/>	
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8792.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8996.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9325.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9147.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9001.xml"/>
<!-- [QLOG] 
draft-ietf-quic-qlog-main-schema-13
IESG State: I-D Exists as of 09/30/25
-->
<reference anchor="I-D.ietf-quic-qlog-main-schema" target="https://datatracker.ietf.org/doc/html/draft-ietf-quic-qlog-main-schema-13">
<front>
<title>qlog: Structured Logging for Network Protocols</title>
<author initials="R." surname="Marx" fullname="Robin Marx" role="editor">
<organization>Akamai</organization>
</author>
<author initials="L." surname="Niccolini" fullname="Luca Niccolini" role="editor">
<organization>Meta</organization>
</author>
<author initials="M." surname="Seemann" fullname="Marten Seemann" role="editor"> </author>
<author initials="L." surname="Pardue" fullname="Lucas Pardue" role="editor">
<organization>Cloudflare</organization>
</author>
<date month="October" day="20" year="2025"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-quic-qlog-main-schema-13"/>
</reference>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.0020.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8471.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9261.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8447.xml"/>
      </references>
    </references>

    <section anchor="example">
      <name>Example</name>
      <t>The following is a sample of a file in SSLKEYLOGFILE format, including secrets from two
      TLS 1.3 connections.</t>
      
<t>The examples below use line wrapping per <xref target="RFC8792"/>.</t>

      <sourcecode type="application/sslkeylogfile"><![CDATA[
CLIENT_HANDSHAKE_TRAFFIC_SECRET \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  be4a28d81ce41242ff31c6d8a6615852178f2cd75eaca2ee8768f9ed51282b38
SERVER_HANDSHAKE_TRAFFIC_SECRET \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  258179721fa704e2f1ee16688b4b0419967ddea5624cd5ad0863288dc5ead35f
CLIENT_HANDSHAKE_TRAFFIC_SECRET \
  b2eb93b8ddab8c228993567947bca1e133736980c22754687874e3896f7d6d0a \
  59ec0981b211a743f22d5a46a1fc77a2b230e16ef0de6d4e418abfe90eff10bf
SERVER_HANDSHAKE_TRAFFIC_SECRET \
  b2eb93b8ddab8c228993567947bca1e133736980c22754687874e3896f7d6d0a \
  a37fe4d3b6c9a6a372396b1562f6f8a40c1c3f85f1aa9b02d5ed46c4a1301365
CLIENT_TRAFFIC_SECRET_0 \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  e9ca165bcb762fab8086068929d26c532e90ef2e2daa762d8b52346951a34c02
SERVER_TRAFFIC_SECRET_0 \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  4f93c61ac1393008d4c820f3723db3c67494f06574b65fcc21c9eef22f90071a
EXPORTER_SECRET \
  cf34899b3dcb8c9fe7160ceaf95d354a294793b67a2e49cb9cca4d69b43593a0 \
  011c900833468f837f7c55d836b2719beebd39b1648fdeda58772f48d94a1ffa
CLIENT_TRAFFIC_SECRET_0 \
  b2eb93b8ddab8c228993567947bca1e133736980c22754687874e3896f7d6d0a \
  e9160bca1a531d871f5ecf51943d8cfb88833adeccf97701546b5fb93e030d79
SERVER_TRAFFIC_SECRET_0 \
  b2eb93b8ddab8c228993567947bca1e133736980c22754687874e3896f7d6d0a \
  fb1120b91e48d402fac20faa33880e77bace82c85d6688df0aa99bf5084430e4
EXPORTER_SECRET \
  b2eb93b8ddab8c228993567947bca1e133736980c22754687874e3896f7d6d0a \
  db1f4fa1a6942fb125d4cc47e02938b6f8030c6956bb81b9e3269f1cf855a8f8
]]></sourcecode>
      <t>Note that secrets from the two connections might be interleaved as shown here,
because secrets could be logged as they are generated.</t>
      <t>The following shows a log entry for a TLS 1.2 connection.</t>
      <sourcecode type="application/sslkeylogfile"><![CDATA[
CLIENT_RANDOM \
  ad52329fcadd34ee3aa07092680287f09954823e26d7b5ae25c0d47714152a6a \
  97af4c8618cfdc0b2326e590114c2ec04b43b08b7e2c3f8124cc61a3b068ba966\
  9517e744e3117c3ce6c538a2d88dfdf
]]></sourcecode>
      <t>The following shows a log entry for a TLS 1.3 connection that successfully
negotiated ECH.</t>
      <sourcecode type="application/sslkeylogfile"><![CDATA[
ECH_SECRET \
  0ba587ee6b65ce21a726630efb881206a7cd995611095b5f4c244bb2b23f1ee1 \
  e8828ec09909cc9363179dc13b62498550c8637129345263011a1678370ca52a
ECH_CONFIG \
  0ba587ee6b65ce21a726630efb881206a7cd995611095b5f4c244bb2b23f1ee1 \
  fe0d003c5500200020d5260ae4cdda08bcbdc37bd0dc53c29aea5f0fdd2b2d594\
  e4235e99b134ac904000400010001000d636f7665722e6465666f2e69650000
CLIENT_HANDSHAKE_TRAFFIC_SECRET \
  8726180bb24718089a4c5c8c93e0ea1c6d6649d7dd3c978fc1413854a20e9647 \
  a195b63ec4270609692a204c08e63e74d9ae58e377d11a383bfe641a63c01140
SERVER_HANDSHAKE_TRAFFIC_SECRET \
  8726180bb24718089a4c5c8c93e0ea1c6d6649d7dd3c978fc1413854a20e9647 \
  022d1cb827a90f27dadde0c99110c2b7d0f362fdfe420a04818aa223e5f2c14c
CLIENT_TRAFFIC_SECRET_0 \
  8726180bb24718089a4c5c8c93e0ea1c6d6649d7dd3c978fc1413854a20e9647 \
  c2310f7db71109de88bab6f2f433fdc1704aecc0d57349cbf9113e5033178172
SERVER_TRAFFIC_SECRET_0 \
  8726180bb24718089a4c5c8c93e0ea1c6d6649d7dd3c978fc1413854a20e9647 \
  04ffc7c154f71ba5f530c7344b0496f60ce71b9b7c6b0e203ea574bfcdf14e27
EXPORTER_SECRET \
  8726180bb24718089a4c5c8c93e0ea1c6d6649d7dd3c978fc1413854a20e9647 \
  befb5db5ac6785b5dd4c6a8c4693c379ec0a1486b5fd035b25e50c3c95abc500
]]></sourcecode>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>The SSLKEYLOGFILE format originated in the Network Security Services (NSS) project, but it has evolved over
time as TLS has changed.  Many people contributed to this evolution.  The authors
are only documenting the format as it is used while extending it to cover ECH.</t>
    </section>
  </back>

<!-- [rfced] Please review the "Inclusive Language" portion of the online
Style Guide <https://www.rfc-editor.org/styleguide/part2/#inclusive_language>
and let us know if any changes are needed.  Updates of this nature typically
result in more precise language, which is helpful for readers.

For example, please consider whether "master" should be updated.
-->

</rfc>
