Use it when configuring HTTPS, or when browsers show certificate or protocol errors.
TLS
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.
certificate and chain installed → key readable by the server → TLS handshake with SNI → client validates chain and name
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
Operational reference
Fast context before you go deeper.
openssl s_client -connect localhost:443 -servername app.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 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 · 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.
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.
openssl s_client -connect <host>:443 -servername <name>— handshake and chain checksystemctl status nginx|apache2|httpd— web server statenginx -t / apachectl configtest— configuration testss -ltnp | grep -E ':80|:443'— listening portscurl -vI https://<name>— response, headers and TLStail -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.orgmatcheswww.example.org, but neitherexample.orgnorwww.sub.example.org. - The session cache reduces repeated handshakes.
Configuration checklist
| Item | Setting |
|---|---|
| Certificate | Full chain (leaf + intermediates) |
| Key | Mode 600 or 640, root-owned |
| Protocols | TLSv1.2, TLSv1.3 (the nginx default) |
| HTTP to HTTPS | A 301 redirect from port 80 |
| HSTS | Strict-Transport-Security: max-age=31536000 once HTTPS works everywhere |
| OCSP stapling | ssl_stapling on; ssl_stapling_verify on; (if the CA supports OCSP) |
| Session cache | ssl_session_cache shared:SSL:10m; |
| Renewal | ACME 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.
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.
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
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 Web Services → TLS. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://nginx.org/en/docs/ · 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 operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for TLS.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | 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. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin 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 chain | listener → TLS policy → SNI selection → certificate/key presentation → chain/trust/hostname/time validation → HTTP request → application response | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | 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. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated 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 response | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It 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 check | Continue 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 boundary | TLS |
|---|---|
| Topic path | Web Services → TLS |
| Runtime state | 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. |
| 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 chain | listener → 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 boundary | 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. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |