Foundations · L1TLS and secure connections

TLS and secure connections

Learn what TLS protects, how a client decides to trust a server, and how to stop certificate expiry from taking your service down.

L1 Must-knowFoundations20 min read
Fact-checked by AI against cited sources · Human review pendingLast reviewed 22 Oct 2026 · How we check content
Section 1 of 8

What broke

On 27 July 2026, at 17:56 UTC, one certificate expired at Lucidworks. It covered several names, including platform.lucidworks.com and api.lucidworks.com. Users of the platform got certificate errors and could not open it 1.

Data was lost too. Usage signals sent to the Beacon endpoint on api.lucidworks.com between 17:56 and 19:01 UTC were not stored. They cannot be recovered 1.

The warning came in time. On 27 June, a monitoring check raised an alert 30 days before expiry. It went to an internal channel, and nobody acted on it. From 1 July, alerts also stopped reaching the incident management system, and nothing watched that path 1.

The team made and installed a new certificate by hand. This took longer because they used a new certificate provider, so they first had to prove they owned the domains in DNS. Service was fully back at 19:24 UTC 1.

Their action items: remove the manual renewal step, and send expiry alerts to a pager that needs a person to answer 1. A certificate fails on a date you know in advance. Seniors plan for that date.

Section 2 of 8

The idea in simple words

When your app calls https://api.shop.example, the data crosses Wi-Fi, ISPs and routers you do not control. TLS protects that path. TLS 1.3 gives three things 3:

  • Confidentiality. Only the two ends can read the data.
  • Integrity. Nobody can change the data without being noticed.
  • Authentication. The server always proves who it is. The client proves who it is only if the server asks.

The server proves its identity with a certificate. A certificate says "this public key belongs to api.shop.example", and is valid between two dates 4. A certificate authority (CA) signs it.

Your app does not know every CA. It knows a small set of root certificates in its trust store. Roots sign intermediate certificates, and intermediates sign site certificates 6. This is the chain of trust.

The key idea. TLS does two jobs: it agrees on secret keys, and it proves the server holds the private key for a certificate the client trusts. The outages in this lesson were not about cryptography. They were about a certificate that expired. A chain the client cannot follow fails the same way.

Section 3 of 8

How it works

Step through one TLS 1.3 handshake and a request. Use Next and Back, or the ← and → keys.

A TLS 1.3 handshake, then one encrypted request Phone app api.shop.example ClientHelloSNI · ALPN · key share ServerHello + key sharethen encrypted: certificates · signature api.shop.examplesigned by: intermediate CAsigned by: root in trust storename ✓ · dates ✓ · signatures ✓ Finishedkeys agreed · 1 round trip GET /orders (encrypted)200 OK (encrypted)✓ private and checked SeniorPath
  1. The app opens a TCP connection, then sends ClientHello. It names the site it wants (SNI), the HTTP versions it speaks (ALPN), and its half of a key exchange.
  2. The server answers with its own key share. Both sides can now make the same secret keys. Everything after this message is encrypted, including the server's certificates.
  3. The app checks the chain. The site's certificate must be signed by an intermediate, and that one by a root in the app's trust store. Names and dates must match too.
  4. The server also signed the handshake with the private key for its certificate. The app checks this and sends Finished. One round trip, and the keys are agreed.
  5. Now the app sends the real request, encrypted with the new keys. Nobody on the network can read it or change it without being noticed.
Step 1 of 5

The TLS 1.3 handshake in plain words

TLS runs on top of a TCP connection. Then:

  1. ClientHello. The client sends the options it supports and its part of a key exchange (a "key share") 3.
  2. ServerHello. The server picks the options and sends its own key share. From here, both sides can compute the same keys. Every handshake message after ServerHello is encrypted 3.
  3. Certificate and proof. The server sends its certificate chain. It also sends a signature over the whole handshake, made with the private key that matches the certificate 3. A thief who copied the certificate but not the private key cannot make this signature.
  4. Finished. The client checks everything and sends Finished. Now application data can flow 3.

This takes one round trip, so RFC 9846 calls it the 1-RTT handshake 3.

How the client checks the chain

The client must check that the certificate is for the host it asked for 5. It then follows the chain. Each certificate must be signed by the next one up, and the top must be signed by a trust anchor, such as a root in the trust store 4. Each certificate must be valid now: the current time must be inside its dates 4.

When the server sends its own certificate plus the intermediate, the client can check every signature up to a root it already trusts. It does not need to download anything else 6.

If the check fails, an automated client must log the error and should close the connection 5.

SNI: many sites on one address

One IP address often serves many domains. The server must know which certificate to send before it can send one. So the client puts the host name in the ClientHello. This is Server Name Indication (SNI) 7. The ClientHello also lists the application protocols the client speaks, such as HTTP/2. This is ALPN 8.

0-RTT and replay

When a client has talked to a server before, TLS 1.3 lets it send data in its very first message. This is called 0-RTT, or early data 3. It saves a round trip, but it has weaker protection. RFC 9846 says there are no guarantees of non-replay between connections 3. An attacker can copy that data and send it again.

For HTTP, clients must not send unsafe methods, like POST, in early data 9. A server that does not want to risk a replay can answer 425 Too Early 9.

Mutual TLS between services

In normal TLS, only the server shows a certificate. With mutual TLS (mTLS), the server also asks the client for one 3. Now both sides know who they talk to. This is common between internal services.

A service mesh such as Istio can do this for you. A proxy next to each service starts the mutual TLS handshake 15. Istio gives each workload a certificate and rotates keys and certificates automatically 15. Its permissive mode accepts both plain text and mTLS, which helps you move services over step by step 15. Then switch to strict mode.

Expiry and automatic renewal

Every certificate has an end date 4. Let's Encrypt certificates are valid for 90 days by default, and it suggests renewing them every 60 days 11. They are getting shorter. On 10 February 2027 the default becomes 64 days, and on 16 February 2028 it becomes 45 days 12. Let's Encrypt warns that a fixed schedule, like a job every 60 days, will then fail 12.

ACME is the protocol that makes renewal automatic. Software proves it controls the domain and gets a certificate with no human involved 10. Before ACME, people often needed 1–3 hours to get and install one certificate 10.

Automation still fails. At ImprovMX, a changed credential made renewals fail silently. An outside monitor gave no warning. The SMTP certificate expired, and sending mail failed for about six hours 2. Their fix: their own expiry checks, and alerts when a renewal fails 2.

HSTS

A user who types shop.example may first reach your site over plain HTTP. An attacker can act there. The Strict-Transport-Security header tells the browser to use only HTTPS for your site from now on 14. The browser then turns http:// links into https:// before it sends anything 13. It also stops users from clicking through certificate errors 14. The first visit is still exposed, and the preload list fixes that 14.

Where TLS ends

TLS protects one hop. Often it ends at the load balancer. An AWS Application Load Balancer uses its certificate to decrypt requests, then sends them to your servers 16. You can send HTTPS to the servers too. But the load balancer does not validate their certificates 17. AWS says this is safe inside the VPC, but traffic that leaves AWS needs more steps 17. To keep traffic encrypted until your server, AWS suggests a Network Load Balancer with a TCP listener, which passes TLS through 16.

Section 4 of 8

Trade-offs

OptionEncrypted untilWho holds certificatesUse it when
End TLS at the load balancerThe load balancer. 16Only the load balancer.Most web apps on a private network.
Re-encrypt to serversThe server, but its certificate is not checked by AWS. 17Load balancer and servers.Rules say all traffic must be encrypted.
TLS passthrough (Network Load Balancer, TCP)The server. 16Only the servers.The load balancer must not see the data.
Mutual TLSBoth ends, both proven. 3Every service. Needs automatic rotation. 15Calls between your own services.
0-RTTWeaker. It can be replayed. 3Same as normal TLS.Only safe, repeatable requests like GET. 9

Simple rule: end TLS at the edge for speed, add mTLS inside when services must prove who they are, and automate every certificate.

Section 5 of 8

At work: how a senior uses this

  • Keep a list of every certificate: where it lives, who owns it, and when it expires. Shared certificates for many names make one expiry hit many services.
  • Ask of each certificate: "What renews it, and what tells us when renewal fails?" Alert on the renewal, not only on the date.
  • Send expiry alerts to the on-call pager, 30 days and 7 days ahead. A chat channel is not enough.
  • Check certificates from outside too, with a probe that follows the full chain like a real client.
  • When one client fails and another works, compare the chain each one receives and the trust store each one uses.
  • Turn off 0-RTT for APIs that change data, unless every request is safe to replay.
  • Never ship code that disables certificate checks, even "only in staging".
Section 6 of 8

With AI

What to ask the agent

"Write a script that lists every TLS certificate on these 40 hosts, with issuer, names and expiry date. Sort by expiry and flag anything under 30 days."

"Review this nginx TLS config. Does it send the full chain? Is 0-RTT on, and is that safe for these endpoints?"

"Our certificate renewal runs from cron every 60 days. Our CA is moving to 45-day certificates. Rewrite it to use ACME Renewal Information, and alert when renewal fails."

What to check yourself

  • The agent did not add verify=False, InsecureSkipVerify or a similar switch to make an error go away.
  • Expiry dates come from the real certificate the server sends, not from a file on disk that may be old.
  • Lifetimes and dates match the CA's current docs. Let's Encrypt changes its lifetimes from 2026 to 2028 12.
  • The mTLS setup checks the client certificate, not only that one exists.
  • HSTS is sent only over HTTPS, and includeSubDomains does not cover a subdomain that still needs HTTP.
Section 7 of 8

Check yourself

1. What does TLS give you on a connection?

Show answer

Encryption, protection against changes, and proof of the server's identity. TLS 1.3 gives confidentiality, integrity, and authentication. The server is always authenticated. The client is only authenticated if the server asks.

2. Why is 0-RTT data risky for a "POST /payments" request?

Show answer

An attacker can capture it and send it again, and TLS does not stop replays across connections. RFC 9846 says there are no guarantees of non-replay between connections. RFC 8470 says clients must not send unsafe methods in early data.

3. Your certificate renewal runs from a cron job every 60 days. Your CA moves to 45-day certificates. What happens?

Show answer

Certificates expire before the job runs, and clients get errors. Let's Encrypt warns that fixed schedules like 60 days will fail. Use ACME Renewal Information, or renew about two thirds of the way through the lifetime.

4. Your load balancer ends TLS and sends plain HTTP to your servers. What is true?

Show answer

Traffic is encrypted only to the load balancer. Inside, it is readable unless you add TLS to the servers too. AWS says an HTTPS listener decrypts requests before it sends them on. For encryption to the server, use HTTPS to the targets, or a Network Load Balancer with a TCP listener.

5. A website sends the HSTS header. What happens next time a user types http:// for it?

Show answer

The browser changes it to https:// before it sends anything. HSTS tells browsers to turn insecure links to that host into secure ones, and not to let users click through certificate errors.

Your progress is saved only in this browser. Export it to keep it safe.

Was this clear?
Report a mistake (opens GitHub in a new tab)
Section 8 of 8

Go deeper

Show 17 sources and related lessons
  1. Lucidworks status page, “SaaS Platform User Interface and Signals Beacon Disruption” (incident report, July 2026) (opens in a new tab)
    A shared certificate expired. The 30-day warning was missed, and later alerts never reached the incident management system.
  2. ImprovMX, “Post Mortem: Expired SMTP TLS Certificate”, May 2026 (opens in a new tab)
    Automatic renewal failed silently after a credential change, an outside monitor gave no warning, and SMTP sending failed for about six hours.
  3. Rescorla, RFC 9846: The Transport Layer Security (TLS) Protocol Version 1.3 (IETF, July 2026) (opens in a new tab)
    The current TLS 1.3 standard. It replaces RFC 8446 and keeps the same version. Sections 1, 2 and 2.3 are the overview.
  4. Cooper et al., RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile (IETF, 2008) (opens in a new tab)
    What a certificate holds, its validity dates, and how a client checks a chain (section 6.1).
  5. Fielding, Nottingham and Reschke (eds.), RFC 9110: HTTP Semantics (IETF, 2022), section 4.3.4 (opens in a new tab)
    An HTTPS client must check that the certificate matches the host, and what to do when it does not.
  6. Let's Encrypt, “Chains of Trust” (opens in a new tab)
    Let's Encrypt's root and intermediate certificates, and how the chain is sent to clients.
  7. Eastlake, RFC 6066: TLS Extensions: Extension Definitions (IETF, 2011), section 3 (opens in a new tab)
    Server Name Indication, so one address can serve many sites.
  8. Friedl, Popov, Langley and Stephan, RFC 7301: TLS Application-Layer Protocol Negotiation Extension (IETF, 2014) (opens in a new tab)
    How the client and server agree on an application protocol, such as HTTP/2, inside the handshake.
  9. Thomson, Nottingham and Tarreau, RFC 8470: Using Early Data in HTTP (IETF, 2018) (opens in a new tab)
    The replay risk of 0-RTT for HTTP, and the 425 Too Early status code.
  10. Barnes, Hoffman-Andrews, McCarney and Kasten, RFC 8555: Automatic Certificate Management Environment (ACME) (IETF, 2019) (opens in a new tab)
    The protocol that lets software prove it controls a domain and get a certificate with no human.
  11. Let's Encrypt, “FAQ” (opens in a new tab)
    Certificate lifetimes, and when to renew.
  12. Matthew McPherrin, “Decreasing Certificate Lifetimes to 45 Days”, Let's Encrypt blog, 2 December 2025 (opens in a new tab)
    The dates when Let's Encrypt certificates get shorter, and why fixed renewal schedules will break.
  13. Hodges, Jackson and Barth, RFC 6797: HTTP Strict Transport Security (HSTS) (IETF, 2012) (opens in a new tab)
    The standard for telling browsers to use only HTTPS for a site.
  14. MDN Web Docs, “Strict-Transport-Security header” (opens in a new tab)
    Header examples, the first-visit weakness, and the preload list.
  15. Istio documentation, “Security” concepts (opens in a new tab)
    Mutual TLS between services through sidecar proxies, automatic certificate rotation, and permissive mode.
  16. AWS, Elastic Load Balancing User Guide, “Create an HTTPS listener for your Application Load Balancer” (opens in a new tab)
    How the load balancer ends TLS, and that passing encrypted traffic through needs a Network or Classic Load Balancer with a TCP listener.
  17. AWS, Elastic Load Balancing User Guide, “Target groups for your Application Load Balancers” (opens in a new tab)
    HTTPS to your servers, and the note that the load balancer does not validate their certificates.

Related: TCP/IP and the network stack · HTTP/1.1, HTTP/2 and HTTP/3 · Authentication and authorization · Secrets and key management · Service mesh and sidecars · Load balancing · Incident response and postmortems

Term

See full entry

Jump to a section

  1. 1What broke
  2. 2The idea in simple words
  3. 3How it works
  4. 4Trade-offs
  5. 5At work
  6. 6With AI
  7. 7Check yourself
  8. 8Go deeper