Pcornel
Browse topics
Options
Recent
Favorites
Web Infrastructure · Technical reference

TLS

Direct answer

TLS on a Linux web server encrypts HTTPS: the server presents its certificate and intermediate chain, negotiates TLS 1.2/1.3 and ciphers, and keeps the private key readable only by the server.

When to use this

Use it when configuring HTTPS, or when browsers show certificate or protocol errors.

First 30 seconds

1. openssl s_client -connect <name>:443 -servername <name> </dev/null — chain and verify result.

2. Expiry: openssl x509 -enddate -noout -in <cert>.

3. Key matches cert? compare openssl x509 -noout -pubkey and openssl pkey -pubout.

4. Protocols: nmap --script ssl-enum-ciphers -p 443 <host>.

5. Renewal timer: systemctl list-timers | grep certbot.

Operational verification

certificate and chain installed → key readable by the server → TLS handshake with SNI → client validates chain and name

Evidence · next step

For Web Services → TLS, continue with the first unproven Topic check: Pin hostname/SNI, endpoint, expected certificate fingerprint/SANs, chain, key source and client trust context. If that boundary is healthy, advance to the adjacent check: Read back effective server TLS configuration and inspect what the live listener actually presents. 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 -connect localhost:443 -servername app.example.com
Scope / prerequisiteUse it when configuring HTTPS, or when browsers show certificate or protocol errors.
What next?3 suggested next steps
Child topics (this level)1
Evidence1
On this pageJump to a specific section
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

listener → TLS policy → SNI selection → certificate/key presentation → chain/trust/hostname/time validation → HTTP request → application response

Healthy evidence: the expected certificate/key pair and chain are presented for SNI, protocol policy matches intent and the real client validates TLS before receiving the expected HTTP response

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Pin hostname/SNI, endpoint, expected certificate fingerprint/SANs, chain, key source and client trust context.

  • Read back effective server TLS configuration and inspect what the live listener actually presents.
  • Verify protocol/chain/hostname from the real client path, then issue the original HTTP request.
  • Apply the smallest cert/key/config change, reload safely, and retest handshake plus application request.

Verification chain. listener → TLS policy → SNI selection → certificate/key presentation → chain/trust/hostname/time validation → HTTP request → application response

Step 3 Commands Verify boundary
openssl s_client -connect localhost:443 -servername app.example.com
nginx -T | grep ssl_
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: stale certificate remains loaded, SNI selects another certificate, key mismatch or missing intermediate breaks validation, protocol policy differs, or TLS works locally but client trust/path fails

Step 5 Common mistakes Narrow the fault
  • Certificate without the intermediate chain.
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.

Key points

Serve the full chain (leaf + intermediates). Disable TLS 1.0/1.1. Renew certificates automatically (certbot timer) and reload the server after renewal. The key must match the certificate.

Key checks
  • openssl s_client -connect <host>:443 -servername <name> — handshake and chain check
  • systemctl status nginx|apache2|httpd — web server state
  • nginx -t / apachectl configtest — configuration test
  • ss -ltnp | grep -E ':80|:443' — listening ports
  • curl -vI https://<name> — response, headers and TLS
  • tail -f /var/log/nginx/error.log — error log (or apache2/httpd)
ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Web TLS is confirmed when the intended endpoint presents the expected identity and completes validation from the real client context before the application request succeeds.

In depth

TLS on web servers: certificates, protocols and checks

Serving HTTPS correctly means a complete certificate chain, a protected key, modern protocols and correct name coverage. The nginx HTTPS guide states the main points:

  • The certificate file lists the server certificate first, then the intermediates.
  • The private key should have restricted access, but must be readable by the master process.
  • The defaults are TLS 1.2 and 1.3 with HIGH:!aNULL:!MD5.
  • SNI lets several certificates share one address.
  • A wildcard certificate covers only one level: *.example.org matches www.example.org, but neither example.org nor www.sub.example.org.
  • The session cache reduces repeated handshakes.

Configuration checklist

ItemSetting
CertificateFull chain (leaf + intermediates)
KeyMode 600 or 640, root-owned
ProtocolsTLSv1.2, TLSv1.3 (the nginx default)
HTTP to HTTPSA 301 redirect from port 80
HSTSStrict-Transport-Security: max-age=31536000 once HTTPS works everywhere
OCSP staplingssl_stapling on; ssl_stapling_verify on; (if the CA supports OCSP)
Session cachessl_session_cache shared:SSL:10m;
RenewalACME client (certbot, acme.sh, lego) with automatic reload

A redirect and HSTS

host$ cat /etc/nginx/conf.d/redirect.conf
server {
    listen 80 default_server;
    server_name _;
    location /.well-known/acme-challenge/ { root /var/www/acme; }
    location / { return 301 https://$host$request_uri; }
}
host$ grep -n "Strict-Transport-Security" /etc/nginx/conf.d/www.conf
12:    add_header Strict-Transport-Security "max-age=31536000" always;
host$ sudo certbot renew --dry-run --deploy-hook "systemctl reload nginx"
host$ curl -sI http://www.example.net | grep -i -E "^HTTP|^location"
HTTP/1.1 301 Moved Permanently
Location: https://www.example.net/
host$ echo | openssl s_client -connect www.example.net:443 -servername www.example.net 2>/dev/null | grep -E "Protocol|Cipher|Verify return"
host$ for v in tls1 tls1_1 tls1_2 tls1_3; do printf "%s " $v; echo | openssl s_client -$v -connect www.example.net:443 2>/dev/null | grep -q "BEGIN CERTIFICATE" && echo yes || echo no; done

Reading the protocol test

The loop checks each TLS version separately. TLS 1.0 and 1.1 should answer "no". On systems whose OpenSSL no longer supports the old versions at all, the client refuses before connecting, which also shows "no". The ACME location on port 80 stays reachable, so certificate renewals keep working even with the redirect in place.

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

TLS is part of Web Services → TLS. Web-service TLS is the server-side binding of certificate/key, protocol policy and SNI identity to a listening web endpoint; it must be verified as presented by the running service.

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. 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. Web-service TLS is the server-side binding of certificate/key, protocol policy and SNI identity to a listening web endpoint; it must be verified as presented by the running service.

Technical metadata. Linux distribution + service/version + client/server/time + DNS/route/firewall + listener/socket + HTTP/TLS/vhost/proxy or NFS/SMB session + identity mapping + backend path/upstream + original workload result.

Interpretation rule. - Certificate files on disk ≠ the running web service presents them.

  • A successful handshake with verification disabled ≠ trusted TLS.
  • Correct certificate dates ≠ hostname and chain validation succeed.
  • TLS success ≠ HTTP authorization or application health.

Quick reference

Modern TLS server settings (Mozilla "intermediate" profile as baseline):

ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_stapling on; ssl_stapling_verify on;
add_header Strict-Transport-Security "max-age=63072000" always;
certbot --nginx -d app.example.com
certbot renew --dry-run
systemctl list-timers | grep certbot

On RHEL, system-wide crypto policies (update-crypto-policies --set DEFAULT|FUTURE) also constrain OpenSSL-based servers.

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. Web TLS is confirmed when the intended endpoint presents the expected identity and completes validation from the real client context before the application request succeeds.

HTTP 502/504 usually localizes beyond front-end TLS into upstream service/path, while connection refusal is earlier. Keep transport, TLS identity/trust, virtual-host selection and upstream application outcome separate.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. This Topic owns web-server TLS integration; Certificates & TLS owns PKI mechanics and certificate-chain troubleshooting.

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 Web Services → TLS. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://nginx.org/en/docs/ · 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
web tlshttps linuxweb server ssl tls
Embedded reference data

Quick lookup tables

TLS operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateWeb-service TLS is the server-side binding of certificate/key, protocol policy and SNI identity to a listening web endpoint; it must be verified as presented by the running service.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact client/server + time + request/file operation → identify authoritative configuration → read back effective service/listener/session state → trace protocol selection/auth/identity → verify backend/upstream boundary → correlate logs → make smallest persistent change → repeat original workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainlistener → TLS policy → SNI selection → certificate/key presentation → chain/trust/hostname/time validation → HTTP request → application responseTrace requested/configured state through effective state to the observed workload result.
Failure boundaryWeb TLS is proven when the intended endpoint presents the expected identity and completes validation from the real client context before the application request succeeds.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux web/file-service evidence can establish this proof path: listener → TLS policy → SNI selection → certificate/key presentation → chain/trust/hostname/time validation → HTTP request → application responseUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. Web TLS is proven when the intended endpoint presents the expected identity and completes validation from the real client context before the application request succeeds.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven service boundary, capture adjacent effective state and protocol/application evidence, make only the demonstrated persistent change, then repeat the original client workload plus a regression check.Continue to the next unresolved boundary while preserving the original test condition.

TLS · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryTLS
Topic pathWeb Services → TLS
Runtime stateWeb-service TLS is the server-side binding of certificate/key, protocol policy and SNI identity to a listening web endpoint; it must be verified as presented by the running service.
Fast checks- Pin hostname/SNI, endpoint, expected certificate fingerprint/SANs, chain, key source and client trust context. - Read back effective server TLS configuration and inspect what the live listener actually presents. - Verify protocol/chain/hostname from the real client path, then issue the original HTTP request. - Apply the smallest cert/key/config change, reload safely, and retest handshake plus application request.
Verification chainlistener → TLS policy → SNI selection → certificate/key presentation → chain/trust/hostname/time validation → HTTP request → application response Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryWeb TLS is proven when the intended endpoint presents the expected identity and completes validation from the real client context before the application request succeeds. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/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?