Use it as the entry point for certificate or TLS errors on Linux servers and clients.
Certificates & TLS
Certificates and TLS on Linux: X.509 certificates bind names to public keys and are signed by CAs; TLS uses them to authenticate servers (and sometimes clients). The system trust store decides which CAs are trusted.
1. openssl s_client -connect <host>:443 -servername <name> — verify return code?
2. Name in SAN? Dates valid?
3. Chain complete (intermediates sent)?
4. Client trusts the root (system store updated)?
5. Renewal automated?
certificate issued → installed with chain and key → TLS handshake → client validates name, dates, chain and trust
For Certificates & TLS, 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 Certificates & TLS. 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_clientPrimary Commands
Configuration and operational commands for this Topic.
Verification & 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
private key → CSR/certificate issuance → leaf/intermediate/root chain → service key/cert load → client trust store/SNI/hostname → TLS handshake → application protocol
Healthy evidence: running service presents the intended leaf and chain, key matches, validity/hostname/trust checks pass and the original client/application succeeds securely
Step 2 Commands Verify boundary
openssl s_client -connect host:443 -servername host </dev/null
openssl x509 -in cert.pem -noout -subject -issuer -dates
update-ca-certificates # Debian
update-ca-trust # RHEL
Step 3 Verification and output interpretation Verify boundary
Verification path. Verify listener and selected virtual host, then inspect certificate presented for the exact hostname/SNI, chain/trust result, dates and negotiated protocol. Test HTTP response and, for proxies, the upstream transaction separately. Compare server config-test output with the running process generation and logs. For certificate issues, inspect subject/SAN, issuer chain and trust path rather than relying on browser wording alone. Preserve the exact client hostname because SNI and verification depend on it.
Verification chain. private key → CSR/certificate issuance → leaf/intermediate/root chain → service key/cert load → client trust store/SNI/hostname → TLS handshake → application protocol
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: service presents stale/wrong certificate, key mismatch, intermediate missing, CA store differs, SNI/hostname mismatch, clock invalidates dates or handshake works while application authorization fails
Step 5 Common mistakes Narrow the fault
- Missing intermediate certificates.
- Private keys world-readable.
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.
Subtopics
Go one level deeper into this subject.
OpenSSL provides Linux cryptographic and TLS tooling for inspecting keys, CSRs, certificates, chains and live handshakes; its output must be interpreted in the context of the exact file, trust store, SNI and endpoint.
Subtopic Private KeysPrivate Keys are secret cryptographic material used to prove possession for TLS and signing; Linux operations must protect generation, storage, permissions, ownership, encryption and service access while proving the key matches its certificate.
Subtopic CSRA Certificate Signing Request binds a requested subject/SAN/public key and requested extensions to a signature from the corresponding private key before CA issuance.
Subtopic CertificatesCertificates are signed X.509 identity/public-key objects with issuer, subject/SAN, serial, validity, key usage and extensions that must match the service role and current endpoint configuration.
Subtopic Certificate ChainCertificate Chain covers how a leaf certificate is linked through intermediates to a trust anchor, including server-sent intermediates, path building and alternate chains.
Subtopic CA CertificatesCA Certificates and Linux trust stores define which certification authorities clients trust, with distribution-specific bundle/update mechanisms and application-specific overrides or private stores.
Subtopic TLS TroubleshootingTLS Troubleshooting isolates failures across DNS/path, SNI, protocol/cipher negotiation, certificate/key presentation, chain building, trust store, hostname, time and application-layer authentication.
Check name (SAN), validity dates, chain completeness and trust store. Different programs may use different trust stores (system, Java, Python certifi). Keep private keys readable only by their service.
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 is resolved only when key/certificate identity, chain/trust and running service configuration are confirmed and the real client/application succeeds with intended verification enabled.
In depth
Working with TLS certificates on Linux
Running TLS services means generating keys, requesting and installing certificates, building chains, and watching expiry dates. OpenSSL's command-line tools cover all of it. The openssl-x509(1) manual page documents the inspection options most used in operations:
-subject,-issuer,-datesand-enddate;-serialand-fingerprint;-ext subjectAltName;-textfor everything;-checkend N, which exits non-zero if the certificate expires within N seconds.
The life cycle
| Stage | Tool | Output |
|---|---|---|
| 1. Generate a private key | openssl genpkey | server.key |
| 2. Create a request (CSR) | openssl req -new | server.csr |
| 3. Get it signed | A CA (internal, ACME/Let's Encrypt, commercial) | server.crt + intermediates |
| 4. Install the certificate and chain | Web server, mail server, load balancer | — |
| 5. Monitor expiry | openssl x509 -checkend, monitoring | Alerts |
| 6. Renew before expiry | ACME client or manual | A new certificate |
File formats
| Format | Recognise by | Notes |
|---|---|---|
| PEM | -----BEGIN CERTIFICATE----- | Base64 text; the Linux default |
| DER | Binary | Common on Windows and Java; convert with -inform/-outform |
| PKCS#12 (.p12/.pfx) | Binary bundle | Key + certificate + chain, password-protected |
| Bundle / fullchain | Several PEM blocks | Leaf first, then intermediates |
Checking a live service
host$ openssl s_client -connect www.example.net:443 -servername www.example.net </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -enddate
subject=CN = www.example.net
issuer=C = US, O = Let's Encrypt, CN = R11
notAfter=Jan 26 08:12:41 2027 GMT
host$ openssl x509 -in /etc/ssl/certs/www.crt -noout -checkend $((21*24*3600)) && echo "valid for 21+ days"
valid for 21+ days
host$ openssl x509 -in /etc/ssl/certs/www.crt -noout -ext subjectAltName
X509v3 Subject Alternative Name:
DNS:www.example.net, DNS:example.net
host$ openssl pkcs12 -export -inkey server.key -in server.crt -certfile chain.pem -out server.p12
host$ for f in /etc/ssl/private/*.crt; do printf '%s ' "$f"; openssl x509 -in "$f" -noout -enddate; done
Monitoring with checkend
-checkend turns expiry into an exit code, which makes it easy to use in monitoring checks and cron jobs. Warn three weeks ahead. Renewals automated with ACME should still be monitored, because a broken renewal job only becomes visible when the certificate expires.
Documented example, not captured output.
How it works at runtime
Certificates & TLS is part of Certificates & TLS. Certificates & TLS is the Linux operational trust reference for private keys, CSRs, X.509 certificates, chain building, CA trust stores and TLS handshake evidence from configured files to the actual service endpoint.
Runtime state ownership and mechanics. TLS combines private-key possession, certificate identity, chain construction, trust anchors, protocol/cipher negotiation, time validity and application-level hostname/SNI behavior. Web serving adds listener/socket binding, virtual-host selection, reverse-proxy upstream routing and HTTP semantics. A TCP connection can therefore succeed while TLS, virtual-host mapping, upstream proxying or application response fails at a later boundary.
Topic-specific state model. Certificates & TLS is the Linux operational trust reference for private keys, CSRs, X.509 certificates, chain building, CA trust stores and TLS handshake evidence from configured files to the actual service endpoint.
Interpretation rule. - A certificate file exists ≠ the running service presents it.
- TLS handshake success ≠ hostname/application authorization, complete trust policy or healthy application protocol.
Quick reference
On Linux, TLS certificates prove a server's identity and enable encrypted connections. A certificate binds a public key to names (Subject Alternative Names), is signed by a certificate authority (CA), and is trusted when the client can build a chain from it, through intermediates, to a root in its trust store. The matching private key must stay on the server and be readable only by the service.
| Item | Typical location |
|---|---|
| System trust store | /etc/ssl/certs/ (Debian/Ubuntu), /etc/pki/tls/certs/ (RHEL) |
| Add a local CA | /usr/local/share/ca-certificates/ + update-ca-certificates, or /etc/pki/ca-trust/source/anchors/ + update-ca-trust |
| Service certificate and key | Defined in the service config (nginx, Apache, Postfix) |
| ACME client | certbot, acme.sh, lego for automatic renewal |
openssl x509 -in server.crt -noout -subject -issuer -dates -ext subjectAltName
openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts </dev/null
openssl verify -CAfile chain.pem server.crt
certbot renew --dry-run
Serve the full chain (leaf plus intermediates), make sure the names in SAN match what clients use, and automate renewal: public certificate lifetimes are shrinking (maximum 200 days since March 2026, falling to 47 days by 2029).
Limits and how it fails
Primary failure point. TLS is resolved only when key/certificate identity, chain/trust and running service configuration are confirmed and the real client/application succeeds with intended verification enabled.
Model. A valid certificate does not show the server presents it, the client trusts its chain or the hostname matches. openssl parsing success does not show key/certificate pairing or live deployment. HTTP 502/504 usually localizes beyond front-end TLS into upstream service/path, while connection refusal is earlier. Apache/Nginx config syntax success is not application health. Keep transport, TLS identity/trust, virtual-host selection and upstream application outcome separate.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Configuration intent and lifecycle. Protect private keys with least privilege and controlled deployment. Build certificate chains in the order expected by the server and keep trust-store management separate from leaf certificate deployment. Validate Apache/Nginx configuration before reload and understand virtual-host/SNI/default-server selection. Reverse proxy settings should define upstream scheme/host headers/timeouts deliberately. Reload should be preferred over disruptive restart when supported and safe.
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. 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
Certificates & TLS operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Certificates & TLS.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Certificates & TLS is the Linux operational trust reference for private keys, CSRs, X.509 certificates, chain building, CA trust stores and TLS handshake evidence from configured files to the actual service endpoint. | 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 | private key → CSR/certificate issuance → leaf/intermediate/root chain → service key/cert load → client trust store/SNI/hostname → TLS handshake → application protocol | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | TLS closes only when key/certificate identity, chain/trust and running service configuration are proven and the real client/application succeeds with intended 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: private key → CSR/certificate issuance → leaf/intermediate/root chain → service key/cert load → client trust store/SNI/hostname → TLS handshake → application protocol | 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 closes only when key/certificate identity, chain/trust and running service configuration are proven and the real client/application succeeds with intended 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. |
Certificates & TLS · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Certificates & TLS |
|---|---|
| Topic path | Certificates & TLS |
| Runtime state | Certificates & TLS is the Linux operational trust reference for private keys, CSRs, X.509 certificates, chain building, CA trust stores and TLS handshake evidence from configured files to the actual service endpoint. |
| Fast checks | - Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for Certificates & TLS. - 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 | private key → CSR/certificate issuance → leaf/intermediate/root chain → service key/cert load → client trust store/SNI/hostname → TLS handshake → application protocol 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 closes only when key/certificate identity, chain/trust and running service configuration are proven and the real client/application succeeds with intended 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. |