Inspect TLS

Record the negotiated connection

Capture TLS version, cipher, key exchange, peer identity, ALPN, and verification result as evidence.

A TLS configuration is a wish. The negotiated connection is what you get. You can configure a server for TLS 1.3 and strong ciphers, but what one client receives depends on both sides, their settings, and anything sitting on the network between them. When someone asks “is this connection secure?”, the honest answer is a recording of one real handshake.

The full s_client output is too noisy to keep in a ticket. Ask for the short version instead:

openssl s_client -brief -connect flaviocopes.com:443 -servername flaviocopes.com </dev/null

-brief cuts the output down to the facts worth recording:

CONNECTION ESTABLISHED
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Peer certificate: CN=flaviocopes.com
Hash used: SHA256
Signature type: ecdsa_secp256r1_sha256
Verification: OK
Negotiated TLS1.3 group: X25519MLKEM768

Save the protocol, the cipher suite, the peer certificate, and the verification status. Verification: OK tells you the chain validated. Anything else on that line names the failure. The last line is the key exchange group, and here it’s a hybrid post-quantum one, which is worth noting in a baseline.

If the service speaks HTTP/2, you can also check which application protocol gets picked. That negotiation is called ALPN, and you offer choices with -alpn:

openssl s_client -alpn h2,http/1.1 -connect flaviocopes.com:443 -servername flaviocopes.com </dev/null 2>/dev/null | grep ALPN
# ALPN protocol: h2

Notice I dropped -brief here. The brief summary doesn’t print the ALPN line, so we grep the full output instead. h2 means the server chose HTTP/2 during the handshake.

Now compare. Force an older protocol with -tls1_2 and put the two summaries side by side:

openssl s_client -brief -tls1_2 -connect flaviocopes.com:443 -servername flaviocopes.com </dev/null
# Protocol version: TLSv1.2
# Ciphersuite: ECDHE-ECDSA-CHACHA20-POLY1305
# Peer Temp Key: X25519, 253 bits

Same server, different protocol, different cipher, different key exchange line. Differences like these jump out when you have two recordings next to each other. And you have evidence for the ticket instead of “it seems fine”.

This habit pays off during incidents. A baseline from last month tells you whether today’s Protocol version: TLSv1.2 is normal for that service or a regression someone shipped.

Don’t judge security from the cipher name alone. A strong-sounding cipher over a connection whose certificate failed verification protects you from nothing. Identity, protocol version, and cipher matter together, which is why the summary records all of them.

Lesson completed