Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Certificates & TLS

Direct answer

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.

When to use this

Use it as the entry point for certificate or TLS errors on Linux servers and clients.

First 30 seconds

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?

Operational verification

certificate issued → installed with chain and key → TLS handshake → client validates name, dates, chain and trust

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandopenssl s_client
Scope / prerequisiteUse it as the entry point for certificate or TLS errors on Linux servers and clients.
Reference · 1
What next?3 suggested next steps
Child topics (this level)7
Catalog command links1
Evidence1
On this pageJump to a specific section
Linux command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic OpenSSL

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 Keys

Private 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 CSR

A 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 Certificates

Certificates 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 Chain

Certificate 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 Certificates

CA 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 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.

Key points

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.

Key checks
  • openssl x509 -in <cert> -noout -subject -issuer -dates -ext subjectAltName — certificate details
  • openssl s_client -connect <host>:443 -servername <name> </dev/null — live chain and verification
  • openssl verify -CAfile <ca> -untrusted <chain> <cert> — chain validation
  • trust 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, -dates and -enddate;
  • -serial and -fingerprint;
  • -ext subjectAltName;
  • -text for everything;
  • -checkend N, which exits non-zero if the certificate expires within N seconds.

The life cycle

StageToolOutput
1. Generate a private keyopenssl genpkeyserver.key
2. Create a request (CSR)openssl req -newserver.csr
3. Get it signedA CA (internal, ACME/Let's Encrypt, commercial)server.crt + intermediates
4. Install the certificate and chainWeb server, mail server, load balancer—
5. Monitor expiryopenssl x509 -checkend, monitoringAlerts
6. Renew before expiryACME client or manualA new certificate

File formats

FormatRecognise byNotes
PEM-----BEGIN CERTIFICATE-----Base64 text; the Linux default
DERBinaryCommon on Windows and Java; convert with -inform/-outform
PKCS#12 (.p12/.pfx)Binary bundleKey + certificate + chain, password-protected
Bundle / fullchainSeveral PEM blocksLeaf 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

ItemTypical 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 keyDefined in the service config (nginx, Apache, Postfix)
ACME clientcertbot, 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).

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
linux tlslinux certificatesopenssl tls
Embedded reference data

Quick lookup tables

Certificates & TLS operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Certificates & TLS.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateCertificates & 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 verificationPin 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 chainprivate key → CSR/certificate issuance → leaf/intermediate/root chain → service key/cert load → client trust store/SNI/hostname → TLS handshake → application protocolTrace requested/configured state through effective state to the observed workload result.
Failure boundaryTLS 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 evidenceCorrelated 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 protocolUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundaryCertificates & TLS
Topic pathCertificates & TLS
Runtime stateCertificates & 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 chainprivate 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 boundaryTLS 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?