Notes

Read a TLS handshake from the command line

Use OpenSSL to check the certificate chain, hostname and negotiated parameters; use curl to see the HTTP request on the same connection.

Use openssl s_client when you need the certificate chain and TLS negotiation details. Use curl when you also need to see redirects, request headers and the selected HTTP version. Always test the hostname you intend to serve: connecting successfully to an IP address is not enough.

Start with a verified handshake

These commands target a public read-only endpoint. Replace the hostname in all three places when testing your service:

openssl version
openssl s_client -connect cloudflare.com:443 \
  -servername cloudflare.com -verify_hostname cloudflare.com \
  -verify_return_error -showcerts -status -alpn 'h2,http/1.1' </dev/null

-servername supplies SNI so a shared server selects the right virtual host. -verify_hostname checks the certificate’s identity. -verify_return_error makes verification failure terminate the connection; without it, the diagnostic client can continue after reporting errors. -showcerts prints the certificates sent by the server, which are not necessarily a complete or trusted chain.

Read the output in this order:

Output What it tells you
Verification result Whether chain and identity verification succeeded with this trust store
Certificate chain Leaf first, followed by intermediates the server sent; roots are usually omitted
Protocol and cipher Negotiated TLS version and record protection
Peer temporary key / negotiated group Key exchange group, separate from the cipher suite
ALPN protocol Application protocol selected from your offer
OCSP response Stapled status response, if the server supplied one

On OpenSSL 3.5, the group may be X25519MLKEM768: a hybrid of X25519 and ML-KEM-768. Its presence does not change a TLS 1.3 cipher name such as TLS_AES_256_GCM_SHA384. Older binaries and TLS backends can show different labels or omit the group. Do not infer the group from the certificate’s public key.

A local OpenSSL 3.5.5 run returned this trimmed output:

Negotiated TLS1.3 group: X25519MLKEM768
Verification: OK
Verified peername: cloudflare.com
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
ALPN protocol: h2
Verify return code: 0 (ok)

-status requests OCSP stapling. “No response sent” means no staple arrived, not that the certificate is revoked. A displayed response also does not establish that every revocation-policy check your application needs has run.

See the HTTP side

curl -v --max-time 15 -o /dev/null https://cloudflare.com/
curl --trace-ascii /tmp/tls-curl-trace.txt --trace-time \
  --max-time 15 -o /dev/null https://cloudflare.com/

Curl verifies certificates by default. Its verbose TLS details depend on the compiled backend; the local test used curl 8.18.0 with OpenSSL 3.5.5. The trace is an alternative to verbose output and records application data too. Run it without cookies or credentials when preparing a shareable diagnostic.

Fix the failure at its source

A hostname mismatch calls for the correct certificate SANs and virtual-host routing. A missing intermediate calls for the server’s full chain bundle, not distribution of the leaf as a trusted root. An expired certificate calls for renewal and a check that every serving instance loaded it; also check your machine’s clock. A private CA requires an explicitly configured trust anchor, for example curl’s --cacert option. Disabling verification hides these failures.

The command details are in the OpenSSL 3.5 s_client manual and curl manual. Go deeper with the TLS handshake and trust dive.