Use it when clients report certificate or handshake errors.
TLS Troubleshooting
TLS troubleshooting finds why a handshake fails: name mismatch, expired certificate, incomplete chain, untrusted CA, protocol or cipher mismatch, SNI or client-certificate requirements.
1. openssl s_client -connect host:443 -servername host — verify code and error?
2. Name/expiry → certificate details.
3. Chain → -showcerts.
4. Protocol → -tls1_2 / -tls1_3; cipher lists.
5. Client side: clock, trust store, proxy intercepting TLS.
TCP → ClientHello (SNI, versions, ciphers) → server certificate → client validation → session
For Certificates & TLS → TLS Troubleshooting, continue with the first unproven Topic check: Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for TLS Troubleshooting. If that boundary is healthy, advance to the adjacent check: Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
openssl s_client -connect host:443 -servername host -tls1_2Verification & 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 Operational evidence path Verify boundary
client + DNS/path → TCP → SNI/protocol/cipher → server certificate/key/chain → client trust/hostname/time → TLS handshake → application protocol/status
Healthy evidence: same endpoint/SNI/client trust context completes verification, expected certificate/chain is presented and original application request succeeds securely
Step 2 Verification and output interpretation Verify boundary
Verification chain. client + DNS/path → TCP → SNI/protocol/cipher → server certificate/key/chain → client trust/hostname/time → TLS handshake → application protocol/status
Step 3 Commands Verify boundary
openssl s_client -connect host:443 -servername host -tls1_2
curl -v https://host
openssl x509 -noout -dates -in cert.pem
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: wrong SNI endpoint, unsupported protocol/cipher, stale certificate, key mismatch, missing intermediate, unknown CA, hostname/time failure, proxy interception or application still fails after handshake
Step 5 Common mistakes Narrow the fault
- Blaming TLS when DNS points to the wrong server.
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.
Use openssl s_client with -servername and read the verify return code. Test the protocol with -tls1_2/-tls1_3. Check the client's clock and trust store.
openssl x509 -in <cert> -noout -subject -issuer -dates -ext subjectAltName— certificate detailsopenssl s_client -connect <host>:443 -servername <name> </dev/null— live chain and verificationopenssl verify -CAfile <ca> -untrusted <chain> <cert>— chain validationtrust list | head / ls /etc/ssl/certs— system trust store
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
TLS troubleshooting is resolved when the first failed handshake/trust/application boundary is confirmed and the original client transaction succeeds with normal verification enabled.
In depth
Test exactly what a client sees
$ openssl s_client -connect app.example.com:443 -servername app.example.com -verify_return_error -CAfile /etc/ssl/certs/ca-certificates.crt </dev/null
CONNECTED(00000003)
depth=2 C = US, O = Example Root CA
depth=1 C = US, O = Example, CN = Example Issuing CA
depth=0 CN = app.example.com
---
Certificate chain
0 s:CN = app.example.com
i:C = US, O = Example, CN = Example Issuing CA
---
Verify return code: 0 (ok)
The OpenSSL s_client manual documents -servername (sets SNI), -showcerts (prints the chain as sent — explicitly not a verified chain), -verify_return_error (abort on verification failure) and -CAfile (trust anchors).
Verify return codes worth knowing
| Code | Meaning | Usual fix |
|---|---|---|
| 0 (ok) | Chain verified | — |
| 2 / 20 unable to get (local) issuer certificate | Intermediate missing from the server's chain, or root not trusted locally | Serve the full chain (fullchain.pem); install the root on the client |
| 10 certificate has expired | Expired leaf or intermediate | Renew; check all chain members |
| 18 / 19 self-signed certificate (in chain) | Private CA not trusted | Add CA to the trust store |
62 hostname mismatch (with -verify_hostname) | Name not in SAN | Reissue with correct SAN |
Other checks
| Question | Command |
|---|---|
| What the certificate contains | openssl x509 -in cert.pem -noout -subject -issuer -dates -ext subjectAltName |
| Key matches certificate | Compare openssl x509 -noout -pubkey -in cert.pem with openssl pkey -pubout -in key.pem |
| Protocol support | openssl s_client -connect host:443 -tls1_2 / -tls1_3 |
| Without SNI | Omit -servername — reveals the default certificate |
| STARTTLS services | -starttls smtp / imap / postgres |
Trust store on the client
Add a private CA with update-ca-certificates (Debian/Ubuntu, file in /usr/local/share/ca-certificates/) or update-ca-trust (RHEL family, file in /etc/pki/ca-trust/source/anchors/). Applications with bundled stores (Java, some Python environments) need their own update.
*The OpenSSL certificate chain uses example identities and does not represent a captured TLS handshake.*
How it works at runtime
TLS Troubleshooting is part of Certificates & TLS → TLS Troubleshooting. TLS Troubleshooting isolates failures across DNS/path, SNI, protocol/cipher negotiation, certificate/key presentation, chain building, trust store, hostname, time and application-layer authentication.
Topic-specific state model. TLS Troubleshooting isolates failures across DNS/path, SNI, protocol/cipher negotiation, certificate/key presentation, chain building, trust store, hostname, time and application-layer authentication.
Interpretation rule. - TCP connection success ≠ TLS handshake success.
- TLS handshake success ≠ application request authorized or healthy.
Method
TLS troubleshooting:
openssl s_client -connect host:443 -servername host -brief
openssl s_client -connect host:443 -tls1_2 # test protocol versions
curl -vI https://host/ 2>&1 | grep -E 'SSL|subject|issuer|expire'
nmap --script ssl-enum-ciphers -p 443 host
| Error | Cause |
|---|---|
| certificate has expired | Renewal failed / clock wrong |
| unable to get local issuer certificate | Missing intermediate or unknown private CA |
| hostname mismatch | SAN does not include the name used; SNI missing |
| handshake failure / no shared cipher | Protocol/cipher policy mismatch (e.g. update-crypto-policies on RHEL) |
| wrong version number | Talking TLS to a plain-HTTP port or vice versa |
Limits and how it fails
Primary failure point. TLS troubleshooting is resolved when the first failed handshake/trust/application boundary is confirmed and the original client transaction succeeds with normal verification enabled.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. TLS Troubleshooting owns end-to-end handshake/trust isolation; hand off to Networking, Certificates, CA trust or application/service topics at the first failing step.
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 Certificates & TLS → TLS Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.openssl.org/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
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.
Quick lookup tables
TLS Troubleshooting operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for TLS Troubleshooting.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | TLS Troubleshooting isolates failures across DNS/path, SNI, protocol/cipher negotiation, certificate/key presentation, chain building, trust store, hostname, time and application-layer authentication. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + boot/time + real identity/workload → identify authoritative policy/key/trust source → read back loaded/effective runtime state → reproduce one safe allow/deny/handshake test → correlate audit/service/kernel evidence → locate first failed boundary → make the smallest persistent change → repeat original workload + regression/recovery check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | client + DNS/path → TCP → SNI/protocol/cipher → server certificate/key/chain → client trust/hostname/time → TLS handshake → application protocol/status | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | TLS troubleshooting closes when the first failed handshake/trust/application boundary is proven and the original client transaction succeeds with normal verification enabled. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux security/trust evidence can establish this proof path: client + DNS/path → TCP → SNI/protocol/cipher → server certificate/key/chain → client trust/hostname/time → TLS handshake → application protocol/status | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved identities, objects, policies, namespaces, endpoints or time periods. TLS troubleshooting closes when the first failed handshake/trust/application boundary is proven and the original client transaction succeeds with normal verification enabled. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven security/trust boundary, capture the adjacent effective state and audit/handshake evidence, make only the demonstrated persistent change, then repeat the original workload plus recovery/regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
TLS Troubleshooting · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | TLS Troubleshooting |
|---|---|
| Topic path | Certificates & TLS → TLS Troubleshooting |
| Runtime state | TLS Troubleshooting isolates failures across DNS/path, SNI, protocol/cipher negotiation, certificate/key presentation, chain building, trust store, hostname, time and application-layer authentication. |
| Fast checks | - Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for TLS Troubleshooting. - Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. - Reproduce one safe allowed/denied or handshake/access test and correlate kernel/service/audit evidence at the first relevant boundary. - Apply the smallest persistent cause-specific change, then repeat the original test plus an adjacent regression/recovery check. |
| Verification chain | client + DNS/path → TCP → SNI/protocol/cipher → server certificate/key/chain → client trust/hostname/time → TLS handshake → application protocol/status Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | TLS troubleshooting closes when the first failed handshake/trust/application boundary is proven and the original client transaction succeeds with normal verification enabled. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |