TLS termination and certificate lifecycle
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Illustrative NGINX server fragment; no certificate files supplied:server { listen 8443 ssl; server_name app.example.test; ssl_certificate /run/tls/fullchain.pem; ssl_certificate_key /run/tls/key.pem; ssl_protocols TLSv1.2 TLSv1.3; location / { proxy_pass http://app:8080; }}Synthetic acceptance checklist:- certificate chain trusted by lab client- SAN includes app.example.test; certificate time valid- private key protected; renewal and reload tested- upstream traffic protection evaluated separatelyUse a local test CA only inside the disposable lab, with explicit trust on the test client; never install a lab CA system-wide on a shared machine. A certificate must cover the requested name and be within its validity interval; an encrypted session alone is insufficient if identity checks are bypassed. Protect the private key from logs, image layers and unauthorized readers. Test renewal before expiry, configuration validation before reload, and the newly served certificate after reload. The example uses plain HTTP upstream for an isolated demonstration; production may require authenticated TLS upstream, including peer name and CA validation. Do not copy this fragment directly to a public listener; certificate issuance, firewall and DNS are separately authorized operations. For the client-side test verify the actual served chain, hostname and time validity without disabling verification. An HTTPS upstream alone does not enable NGINX upstream certificate verification; explicitly review verification, trusted CA and expected peer name/SNI when required.
Common mistake
Never fix a hostname or trust error by disabling certificate verification. Correct the name, certificate chain or trust configuration.
Manual practice
For a certificate valid for other.example.test but requested as app.example.test, write the expected rejection and the repair plan. Add a renewal test and a private-key access review.
Worksheet: lab-fixtures/docker-production-deployment/03-tls/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
TLS termination and certificate lifecycle — Knowledge check
Interpret production deployment evidence and make a safe operational decision.
What must a TLS client verify besides encryption?
What happens to TLS at a terminating proxy?
What confirms a renewal actually reached clients?