<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Tls · Network Doodles</title><link>https://networkdoodles.com/tags/tls/</link><description>Network automation, from first playbook to agentic operations. Ansible, NetBox, MCP, Python and the occasional doodle.</description><language>en-us</language><managingEditor>David Henderson</managingEditor><lastBuildDate>Mon, 16 Nov 2026 09:00:00 -0500</lastBuildDate><atom:link href="https://networkdoodles.com/tags/tls/index.xml" rel="self" type="application/rss+xml"/><item><title>What TLS Shows Without Decrypting It: SNI, Versions and Ciphers (Wireshark 101, Lesson 7)</title><link>https://networkdoodles.com/lessons/wireshark-101/tls-without-decryption/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/lessons/wireshark-101/tls-without-decryption/</guid><category>wireshark</category><category>packet-capture</category><category>networking-basics</category><category>tls</category><description>What a TLS handshake shows without decrypting: SNI, versions, cipher, ALPN and the certificate, TLS 1.2 vs 1.3, and key log files for your own traffic.</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>TLS encrypts the content of a connection, but not the start of it. Before the two ends can encrypt anything,
they have to agree how, and that negotiation, the <strong>handshake</strong>, is partly in the clear. From a capture,
without any keys, you can read the server name the client asked for, the TLS versions and cipher suites it
offered, the ones the server chose, and the application protocols on offer. In TLS 1.2 you can read the
server&rsquo;s certificate too. In TLS 1.3 you can&rsquo;t. And with a key log file from your own client, you can decrypt
the rest.</p>
<p>That&rsquo;s usually all a network engineer needs. When an HTTPS connection fails, the question is rarely &ldquo;what was in
the page&rdquo;. It&rsquo;s &ldquo;which name, which version, which certificate, and did the handshake finish&rdquo;. This lesson uses
two connections from the <a href="/labs/wireshark-101/">Wireshark 101 lab</a>: curl opening <code>https://web.lab/</code> with TLS
1.3, and <code>https://intranet.lab/secret.txt</code> with TLS 1.2.</p>
<hr>
<h2 id="what-is-tls-and-what-does-it-hide">What is TLS, and what does it hide?</h2>
<p><strong>TLS</strong> (Transport Layer Security) is the S in HTTPS. It runs on top of an ordinary TCP connection
(<a href="/lessons/wireshark-101/tcp/">lesson 6</a>) and encrypts everything the application sends: the page, the path
after the name, headers, cookies, passwords. In a capture, all of that is a series of records labeled
<em>Application Data</em>, with a length and nothing else.</p>
<p>What it doesn&rsquo;t hide:</p>
<table>
  <thead>
      <tr>
          <th>Visible</th>
          <th>Where</th>
          <th>Why it&rsquo;s there</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>IP addresses and ports</td>
          <td>IP and TCP headers</td>
          <td>TLS rides inside TCP; routers still need them</td>
      </tr>
      <tr>
          <td><strong>SNI</strong>, the server name</td>
          <td>Client Hello</td>
          <td>one server can host many names, and it needs to know which certificate to send</td>
      </tr>
      <tr>
          <td>versions and cipher suites offered</td>
          <td>Client Hello</td>
          <td>the client lists what it can do</td>
      </tr>
      <tr>
          <td>version and cipher suite chosen</td>
          <td>Server Hello</td>
          <td>the server picks one of each</td>
      </tr>
      <tr>
          <td><strong>ALPN</strong> protocols offered</td>
          <td>Client Hello</td>
          <td>which application protocol will run inside, such as <code>h2</code> or <code>http/1.1</code></td>
      </tr>
      <tr>
          <td>the server&rsquo;s certificate</td>
          <td>TLS 1.2 only</td>
          <td>in TLS 1.3 it&rsquo;s encrypted</td>
      </tr>
      <tr>
          <td>record sizes and timing</td>
          <td>every record</td>
          <td>encryption hides content, not length</td>
      </tr>
  </tbody>
</table>
<p>The <strong>Client Hello</strong> is the client&rsquo;s first message: everything it supports, in one go. The <strong>Server Hello</strong> is
the server&rsquo;s reply with its choices. Everything else follows from those two.</p>
<hr>
<h2 id="sni-the-name-you-asked-for">SNI: the name you asked for</h2>
<p><strong>SNI</strong> (Server Name Indication) is an extension in the Client Hello that carries the host name. Wireshark puts
it straight into the Info column:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"> 9 0.321656708 192.168.1.175 → 192.168.2.10 SSL 1514
</span></span><span class="line"><span class="cl">10 0.321665750 192.168.1.175 → 192.168.2.10 TLSv1.2 176 Client Hello (SNI=web.lab)
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">34 0.389741458 192.168.1.175 → 192.168.2.10 SSL 1514
</span></span><span class="line"><span class="cl">35 0.389743208 192.168.1.175 → 192.168.2.10 TLSv1.2 181 Client Hello (SNI=intranet.lab)
</span></span></code></pre></div><p>Both connections go to the same address, 192.168.2.10. The IP header can&rsquo;t tell them apart. The SNI can. It
exists because one address commonly serves many names, and the server has to choose the right certificate
before any encryption starts.</p>
<p>That makes SNI the most useful field in an HTTPS capture. It&rsquo;s how you find which connection is the one to
the site that&rsquo;s broken, and it&rsquo;s what firewalls, proxies and monitoring tools that don&rsquo;t decrypt use to decide
what a connection is. The filter <code>tls.handshake.extensions_server_name == &quot;web.lab&quot;</code> finds every connection to
one name.</p>
<hr>
<h2 id="why-does-the-client-hello-say-tls-12-when-its-tls-13">Why does the Client Hello say TLS 1.2 when it&rsquo;s TLS 1.3?</h2>
<p>Look at the Protocol column above: the Client Hello says <em>TLSv1.2</em>. Open it and it gets stranger:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">TLSv1.3 Record Layer: Handshake Protocol: Client Hello
</span></span><span class="line"><span class="cl">    Version: TLS 1.0 (0x0301)
</span></span><span class="line"><span class="cl">    Handshake Protocol: Client Hello
</span></span><span class="line"><span class="cl">        Version: TLS 1.2 (0x0303)
</span></span><span class="line"><span class="cl">        ...
</span></span><span class="line"><span class="cl">        Extension: supported_versions (len=5) TLS 1.3, TLS 1.2
</span></span></code></pre></div><p>Three version numbers in one message, and only the last one is honest. This is deliberate.
<a href="https://www.rfc-editor.org/rfc/rfc8446">RFC 8446</a>, the TLS 1.3 standard, freezes the old version fields at
TLS 1.2 (and allows 1.0 on the record of the first Client Hello), because some middleboxes broke connections
that showed a version they didn&rsquo;t recognize. The real negotiation moved into an extension,
<code>supported_versions</code>, where the client lists every version it can do and the server answers with the one it
picked.</p>
<p>The Server Hello shows the result:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">TLSv1.3 Record Layer: Handshake Protocol: Server Hello
</span></span><span class="line"><span class="cl">    Version: TLS 1.2 (0x0303)
</span></span><span class="line"><span class="cl">    Handshake Protocol: Server Hello
</span></span><span class="line"><span class="cl">        Version: TLS 1.2 (0x0303)
</span></span><span class="line"><span class="cl">        Cipher Suite: TLS_AES_256_GCM_SHA384 (0x1302)
</span></span><span class="line"><span class="cl">        Extension: supported_versions (len=2) TLS 1.3
</span></span><span class="line"><span class="cl">        Extension: key_share (len=1124) X25519MLKEM768
</span></span></code></pre></div><p>Twice &ldquo;TLS 1.2&rdquo;, once &ldquo;TLS 1.3&rdquo;, and the extension wins. Wireshark knows this and labels the record TLSv1.3. The
rule for reading a version: <strong>trust <code>supported_versions</code> in the Server Hello.</strong> If there isn&rsquo;t one, the
connection is TLS 1.2 or older, and the Server Hello&rsquo;s own version field is the real one. The filter
<code>tls.handshake.extensions.supported_version == 0x0304</code> matches TLS 1.3 handshakes.</p>
<hr>
<h2 id="cipher-suites-offered-and-chosen">Cipher suites: offered and chosen</h2>
<p>A <strong>cipher suite</strong> names the algorithms a connection will use. The laptop&rsquo;s curl offered 30 of them, most
preferred first:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Cipher Suites (30 suites)
</span></span><span class="line"><span class="cl">    Cipher Suite: TLS_AES_256_GCM_SHA384 (0x1302)
</span></span><span class="line"><span class="cl">    Cipher Suite: TLS_CHACHA20_POLY1305_SHA256 (0x1303)
</span></span><span class="line"><span class="cl">    Cipher Suite: TLS_AES_128_GCM_SHA256 (0x1301)
</span></span><span class="line"><span class="cl">    Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c)
</span></span><span class="line"><span class="cl">    Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030)
</span></span><span class="line"><span class="cl">    ...
</span></span></code></pre></div><p>The first three are TLS 1.3 suites. In 1.3 a suite names only the encryption (AES-256 in GCM mode) and the hash
(SHA-384); the key exchange is negotiated separately. The rest are TLS 1.2 suites, which name everything in one
string: <code>ECDHE_RSA_WITH_AES_256_GCM_SHA384</code> is an ECDHE key exchange, an RSA certificate, AES-256-GCM and SHA-384.</p>
<p>The two lab connections chose differently:</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th>TLS 1.3 connection</th>
          <th>TLS 1.2 connection</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Version</td>
          <td>TLS 1.3 (from <code>supported_versions</code>)</td>
          <td>TLS 1.2 (no <code>supported_versions</code>)</td>
      </tr>
      <tr>
          <td>Cipher suite</td>
          <td><code>TLS_AES_256_GCM_SHA384</code> (0x1302)</td>
          <td><code>TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384</code> (0xc030)</td>
      </tr>
      <tr>
          <td>ALPN chosen</td>
          <td>encrypted</td>
          <td><code>http/1.1</code>, in the clear</td>
      </tr>
      <tr>
          <td>Certificate</td>
          <td>encrypted</td>
          <td>in the clear</td>
      </tr>
  </tbody>
</table>
<p>When a handshake fails because the two sides have nothing in common, this is where you see it: compare the
client&rsquo;s list with what the server supports. A server that answers a Client Hello with an alert instead of a
Server Hello usually didn&rsquo;t like something in that list.</p>
<hr>
<h2 id="why-is-the-labs-client-hello-1558-bytes">Why is the lab&rsquo;s Client Hello 1,558 bytes?</h2>
<p>Notice frame 9 in the listing above: <em>SSL, 1514 bytes</em>, with no description. The Client Hello didn&rsquo;t fit in one
packet. It&rsquo;s 1,558 bytes of TCP payload, more than the 1,460 a segment can carry on a 1,500-byte network, so TCP
split it, and Wireshark can only decode it once frame 10 completes it.</p>
<p>The reason is its <strong>key share</strong>. In TLS 1.3 the client guesses which key exchange the server will pick and sends
its half of it straight away, to save a round trip. curl on the lab&rsquo;s laptop offers <code>X25519MLKEM768</code> first: a
hybrid that combines the classic X25519 exchange with ML-KEM, a key exchange designed to resist future quantum
computers.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Extension: key_share (len=1258) X25519MLKEM768, x25519
</span></span><span class="line"><span class="cl">    Key Share Entry: Group: X25519MLKEM768, Key Exchange length: 1216
</span></span><span class="line"><span class="cl">    Key Share Entry: Group: x25519, Key Exchange length: 32
</span></span></code></pre></div><p>The hybrid share is 1,216 bytes; the plain X25519 one is 32. The server took the hybrid, and its own share in the
Server Hello is 1,120 bytes. A whole Client Hello from a few years ago fitted in a few hundred bytes. The
lab&rsquo;s TLS 1.2 Client Hello, which leaves out the TLS 1.3 key shares, is a 292-byte frame.</p>
<p>That size has consequences. A Client Hello that needs two segments is the first thing to break on a path with an
MTU problem, while ping, DNS and small HTTP requests keep working.
<a href="/lessons/wireshark-101/broken-path/">Lesson 8</a> breaks exactly that.</p>
<hr>
<h2 id="alpn-which-protocol-runs-inside">ALPN: which protocol runs inside</h2>
<p><strong>ALPN</strong> (Application-Layer Protocol Negotiation) lets the client say which protocols it can speak inside the
encrypted connection. curl offered two:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Extension: application_layer_protocol_negotiation (len=14)
</span></span><span class="line"><span class="cl">    ALPN Next Protocol: h2
</span></span><span class="line"><span class="cl">    ALPN Next Protocol: http/1.1
</span></span></code></pre></div><p><code>h2</code> is HTTP/2. The server&rsquo;s choice is where TLS 1.2 and 1.3 differ. In TLS 1.2 it&rsquo;s in the Server Hello, in the
clear: the lab&rsquo;s server answered <code>http/1.1</code>. In TLS 1.3 it moved into the <em>Encrypted Extensions</em> message, sent
after encryption starts, so a capture only shows what was offered.</p>
<hr>
<h2 id="the-certificate-in-the-clear-in-12-encrypted-in-13">The certificate: in the clear in 1.2, encrypted in 1.3</h2>
<p>A <strong>certificate</strong> is a signed document that says &ldquo;this public key belongs to these names&rdquo;, signed by a
<strong>certificate authority</strong> (CA) that the client already trusts. In TLS 1.2 the server sends it in the clear, right
after its Server Hello:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">11 0.252885000 192.168.2.10 → 192.168.1.175 TLSv1.2 1402 Server Hello, Certificate, Server Key Exchange, Server Hello Done
</span></span></code></pre></div><p>Open it and the details are all there:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">issuer: rdnSequence (0)
</span></span><span class="line"><span class="cl">    rdnSequence: 2 items (id-at-commonName=Network Doodles Lab CA,id-at-organizationName=Network Doodles Lab)
</span></span><span class="line"><span class="cl">subject: rdnSequence (0)
</span></span><span class="line"><span class="cl">    rdnSequence: 2 items (id-at-commonName=web.lab,id-at-organizationName=Network Doodles Lab)
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">    GeneralName: dNSName (2)
</span></span><span class="line"><span class="cl">        dNSName: web.lab
</span></span><span class="line"><span class="cl">    GeneralName: dNSName (2)
</span></span><span class="line"><span class="cl">        dNSName: intranet.lab
</span></span></code></pre></div><p>The client asked for <code>intranet.lab</code>, and got a certificate whose common name is <code>web.lab</code>. That isn&rsquo;t an error:
the <strong>subjectAltName</strong> (SAN) list covers both names, and the SAN list is what clients check. Reading this off the
wire is how you settle &ldquo;certificate name mismatch&rdquo; and &ldquo;unknown issuer&rdquo; arguments without logging in to the
server.</p>
<p>In TLS 1.3, the Server Hello is followed by <em>Change Cipher Spec, Application Data</em>. The Change Cipher Spec is a
leftover that RFC 8446 keeps for middlebox compatibility. The certificate is inside the Application Data,
encrypted with keys from the key exchange. A capture of a TLS 1.3 connection doesn&rsquo;t show which certificate the
server sent.</p>
<hr>
<h2 id="decrypting-your-own-traffic-with-a-key-log-file">Decrypting your own traffic with a key log file</h2>
<p>You can&rsquo;t decrypt someone else&rsquo;s TLS from a capture. With an ephemeral key exchange, which both lab connections
used (ECDHE in 1.2, the X25519MLKEM768 hybrid in 1.3), even the server&rsquo;s private key isn&rsquo;t enough: each connection makes fresh keys and throws them away.
That property is called forward secrecy.</p>
<p>But you can decrypt your <strong>own</strong> traffic, because your client knows the keys. Many TLS libraries write their
session secrets to a file when the environment variable <code>SSLKEYLOGFILE</code> names one. curl does, and so do Firefox
and Chrome. The file is plain text, one line per secret:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">CLIENT_RANDOM &lt;64 hex digits: the Client Hello&#39;s random&gt; &lt;96 hex digits: the session&#39;s secret&gt;
</span></span></code></pre></div><p>The random value tells Wireshark which connection a line belongs to. Point Wireshark at the file (the TLS
protocol preferences, <em>(Pre)-Master-Secret log filename</em>) and the Application Data becomes what it was:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">15 0.259969042 192.168.1.175 → 192.168.2.10 HTTP 181 GET /secret.txt HTTP/1.1
</span></span><span class="line"><span class="cl">16 0.260409750 192.168.2.10 → 192.168.1.175 HTTP 442 HTTP/1.1 200 OK  (text/plain)
</span></span></code></pre></div><p>The capture didn&rsquo;t change. The keys are the only thing that makes it readable. Wireshark&rsquo;s
<a href="https://wiki.wireshark.org/TLS">TLS page</a> covers the other ways to supply keys.</p>
<h3 id="why-a-key-log-file-is-as-sensitive-as-a-password">Why a key log file is as sensitive as a password</h3>
<p>Anyone who has the key log file and a capture of the same traffic can read everything in it: session cookies,
passwords typed into forms, API tokens. It defeats forward secrecy completely, after the fact, for every
connection in the file. So:</p>
<ul>
<li>set <code>SSLKEYLOGFILE</code> for one debugging session, in one shell, never in a profile that every program inherits;</li>
<li>keep the file next to the capture only as long as you need it, then delete both;</li>
<li>never attach a key log file to a ticket, a chat or a shared drive with the capture.</li>
</ul>
<hr>
<h2 id="what-about-encrypted-client-hello">What about Encrypted Client Hello?</h2>
<p><strong>ECH</strong> (Encrypted Client Hello) closes the biggest gap left in TLS 1.3. It was published in March 2026 as
<a href="https://www.rfc-editor.org/rfc/rfc9849">RFC 9849</a>. The client sends an outer Client Hello in the clear and the
real one encrypted inside it, so the real server name and the ALPN list are hidden. The outer Client Hello still
carries a server name, but it&rsquo;s a public name chosen by the server&rsquo;s operator, often shared by many sites. The
lab doesn&rsquo;t use ECH. Where it is used, the SNI in a capture tells you less than this lesson suggests.</p>
<hr>
<h2 id="what-i-see-go-wrong">What I see go wrong</h2>
<p><strong>Reading the wrong version.</strong> The Protocol column and the record header both say 1.2 for a TLS 1.3 Client
Hello. Read <code>supported_versions</code> in the Server Hello, every time.</p>
<p><strong>Hunting for the certificate in TLS 1.3.</strong> It isn&rsquo;t there to find. If you need to see which certificate a
server sends, connect with a client that shows it, or decrypt your own session.</p>
<p><strong>Missing a split Client Hello.</strong> A frame marked <em>SSL</em> with no description, followed by the Client Hello, is one
message in two segments. That&rsquo;s normal, and it&rsquo;s also the first thing to vanish on a path with an MTU problem.</p>
<p><strong>Leaving <code>SSLKEYLOGFILE</code> set.</strong> It quietly keeps writing secrets for every connection every program makes. Set
it for one command, and unset it.</p>
<hr>
<h2 id="try-it">Try it</h2>
<p><a href="/labs/wireshark-101/#chapter-7">Chapter 7 of the lab</a> has you read the SNI, the versions, the cipher and ALPN
from two connections, then read a TLS 1.2 certificate and decrypt a page with the key log file curl saved.</p>
<h2 id="whats-next">What&rsquo;s next</h2>
<p><a href="/lessons/wireshark-101/broken-path/">Lesson 8</a> puts the whole course to work on three broken paths: packet
loss, a fault the lab picks at random, and a black hole that lets ping through but not that 1,558-byte Client
Hello.</p>
]]></content:encoded></item></channel></rss>