Use it when a secure connection fails although TCP connects: version or cipher mismatch, a certificate the client does not trust, or a name that does not match.
TLS Record & Handshake Evidence
TLS encrypts and authenticates traffic on top of TCP. Before data flows, client and server perform a handshake: they agree on a version and cipher, the server presents its certificate, and keys are derived.
1. openssl s_client -connect <host>:443 -servername <host> — does the handshake complete? What does "Verify return code" say?
2. Certificate: dates valid, name listed, intermediates sent?
3. Alert protocol_version or handshake_failure → no version or cipher in common.
4. Reset right after the ClientHello → a device filters on the server name.
5. Unexpected issuer → an inspecting proxy re-signs the traffic.
TCP connects → ClientHello with server name → ServerHello: version and cipher in common → certificate chain trusted, in date, name matches → keys derived, Finished → application data
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
openssl s_client -connect www.example.com:443 -servername www.example.comVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification workflow Verify boundary
openssl s_client -connect www.example.com:443 -servername www.example.com
openssl s_client -connect www.example.com:443 -servername www.example.com -tls1_2
curl -v https://www.example.com/
openssl x509 -noout -subject -issuer -dates -ext subjectAltName
openssl s_client performs a handshake and prints the certificate chain, the verification result, and the protocol and cipher agreed; forcing a version with -tls1_2 or -tls1_3 tests what the server accepts. curl -v shows the handshake steps and any error from a normal client's point of view. Piping a certificate into openssl x509 prints its names and dates.
In Wireshark, filter on tls.handshake to see the hello messages, on tls.handshake.extensions_server_name for the requested name, and on tls.alert_message for alerts.
Known-good: the handshake completes, verification returns OK, the certificate covers the requested name and is within its dates.
Step 2 Failure isolation workflow Narrow the fault
- TCP connects, the ClientHello is sent, and the connection is reset or closed. The server or a device in front of it rejects the hello: an unsupported version, an unknown server name, or filtering on the name.
- Alert protocol_version or handshake_failure. No version or cipher in common — an old client against a hardened server, or the reverse.
- Alert unknown_ca, or "unable to verify" at the client. The server does not send its intermediate certificate, or the issuing authority is not trusted by this client.
- Certificate expired. Check the dates — and the client's clock.
- Name mismatch. The certificate does not list the name used; with no SNI, a server returns its default certificate.
- Works in a browser, fails from a script or device. Different trusted authorities, or the client does not send SNI.
- The certificate presented is not the server's own. An inspecting firewall or proxy is re-signing the traffic; clients must trust its authority.
- The handshake completes and the application still fails. TLS is done; look at the application protocol.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The ClientHello — with the requested server name — and the ServerHello are readable in a capture; in TLS 1.3 everything after is encrypted. Failures are reported as alerts with explicit codes. The client checks three things in the certificate: a trusted chain, valid dates, and the name.
openssl s_client -connect <host>:443 -servername <host>— the chain, the verification result, the version and cipher agreed.- Add
-tls1_2or-tls1_3— what the server accepts. curl -v https://<host>/— the handshake and any error as a normal client sees it.- Wireshark:
tls.handshake,tls.alert_message.
ReferenceWhat it is1 section · depth on demand
Mental model
TLS is the protocol that encrypts and authenticates most traffic on top of TCP — HTTPS above all. Before any application data flows, client and server perform a handshake to agree on a protocol version and cipher, check the server's certificate and derive keys. Everything TLS sends is packed into records with a small visible header.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
When a secure connection fails after TCP has connected, the cause is in the handshake: no common version, a certificate the client does not trust, a name that does not match. The first handshake messages are sent unencrypted, and TLS reports failures with explicit alert codes, so a capture or a test client usually shows exactly which step failed.
ReferenceHow it works1 section · depth on demand
How it works
Records. Each record starts with a 5-byte header: content type, version and length.
| Content type | Meaning |
|---|---|
| 20 | Change cipher spec |
| 21 | Alert — a warning or a fatal error |
| 22 | Handshake |
| 23 | Application data (encrypted) |
The handshake in TLS 1.2 — two round trips:
1. ClientHello — the versions and cipher suites the client supports, and extensions: the server name it wants (SNI) and the application protocols it offers (ALPN).
2. ServerHello — the version and cipher chosen. Certificate — the server's certificate chain. ServerHelloDone.
3. Client key exchange, ChangeCipherSpec, Finished.
4. Server ChangeCipherSpec, Finished. Application data follows.
In TLS 1.3 — one round trip. The ClientHello already carries key material, so everything after the ServerHello is encrypted, including the certificate. In a capture only ClientHello and ServerHello are readable; the rest appears as application data. The real version is in the supported_versions extension — the record header still says 1.2 for compatibility.
What stays visible. The ClientHello, with the server name; the ServerHello, with the chosen version and cipher; in TLS 1.2 also the certificate; and alerts sent before encryption starts.
Alerts name the failure:
| Code | Alert | Usual cause |
|---|---|---|
| 0 | close_notify | Normal end of the session |
| 40 | handshake_failure | No cipher suite in common, or a required client certificate missing |
| 42 | bad_certificate | The certificate could not be processed |
| 45 | certificate_expired | Past its validity date |
| 48 | unknown_ca | Issued by an authority the receiver does not trust |
| 70 | protocol_version | No TLS version in common |
| 112 | unrecognized_name | The server does not know the name sent in SNI |
What the client checks in the certificate: that the chain leads to an authority it trusts, that the current date is within the validity period, and that the name it connected to is listed in the certificate. The server must send any intermediate certificates along with its own.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
TLS 1.3 handshake evidence
When TCP connects but the secure session fails, the evidence is in the TLS handshake. RFC 8446 defines the TLS 1.3 flow. The client sends ClientHello with its key shares and supported versions. The server answers with ServerHello, then sends EncryptedExtensions, Certificate, CertificateVerify and Finished, all already encrypted. The client completes with Finished. If none of the client's key shares fits the server's chosen group, the server sends HelloRetryRequest and the client tries again. Version negotiation uses the supported_versions extension, while the legacy version field stays at 0x0303.
What is visible on the wire
| Message | Visible to a network capture? |
|---|---|
| ClientHello (SNI, versions, cipher suites, ALPN) | Yes |
| ServerHello (chosen version and cipher suite) | Yes |
| Certificate and everything after it | No, encrypted in TLS 1.3 |
| Alerts | Their content is encrypted once the handshake keys are in use |
Alerts that explain failures (RFC 8446)
| Alert | Code | Usual cause |
|---|---|---|
| close_notify | 0 | Orderly closure, not an error |
| handshake_failure | 40 | No common parameters |
| bad_certificate | 42 | Certificate rejected, often a client certificate |
| certificate_expired | 45 | Expired certificate |
| unknown_ca | 48 | Issuer not trusted |
| protocol_version | 70 | No common TLS version |
| no_application_protocol | 120 | ALPN mismatch, for example HTTP/2 only |
All error alerts in TLS 1.3 are fatal. A failed record decryption must end the connection with bad_record_mac.
host$ openssl s_client -connect www.example.net:443 -servername www.example.net -tls1_3 </dev/null 2>&1 | grep -E "Protocol|Cipher|Verify return|subject=|issuer="
host$ curl -sv https://www.example.net/ -o /dev/null 2>&1 | grep -E "SSL connection|ALPN|expire|issuer"
host$ tshark -r capture.pcap -Y "tls.handshake.type==1" -T fields -e tls.handshake.extensions_server_name -e tls.handshake.extensions.supported_version
www.example.net 0x0304,0x0303
host$ tshark -r capture.pcap -Y "tls.alert_message" -T fields -e ip.src -e tls.alert_message.desc
0-RTT caution
Early data (0-RTT) lets a returning client send requests in its first flight. RFC 8446 notes that early data isn't forward secret and has weaker replay protection, so servers should accept it only for idempotent requests.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → TLS Record & Handshake Evidence. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.