Writing

TLS does not make a service trustworthy

A padlock in the address bar is a small, effective piece of UX. It tells the visitor that the connection is encrypted and that the certificate matches the name in the URL. It does not tell them anything about the code behind the page.

I have seen the reverse mistake often enough: a service is considered secure because TLS is enabled, while authentication is missing, a debug endpoint is public or an admin session lives forever. The certificate is real. The conclusion is too large.

TLS protects a connection. A service needs boundaries around identity, authorization, input, storage and failure. Those boundaries do not arrive with the certificate.


A padlock on an open shipping container, lit by a narrow amber beam.
A padlock can secure the door. It cannot tell you what is inside the container. Cover illustration created for this essay.

What the handshake actually promises

A successful TLS handshake gives me three useful things. The client is talking to an endpoint that presented a certificate for the requested name. The bytes in transit are encrypted and integrity protected. The connection resists some downgrade and replay attempts when the configuration is correct.

It does not prove that the application is honest, that the user is authenticated, that the database query is safe or that the server is not running a vulnerable dependency. It does not protect data at rest. It does not make an HTTP endpoint on the other side of the proxy trustworthy.

This is not a reason to skip TLS. It is a reason to stop treating it as the security model.

Termination is a boundary, not a checkbox

In a typical deployment, TLS ends at a reverse proxy. The proxy holds the certificate, speaks HTTPS to the client and forwards plain HTTP to the application on a private interface. That is a normal design. It also creates a new question: how much does the application trust the headers it receives?

A proxy can add `X-Forwarded-Proto`, `X-Forwarded-For` and a host header. If the application accepts those values from any client, a direct connection can spoof them. If the application only listens on loopback and the proxy is the only public door, the trust path is much easier to explain.

server {
  listen 80;
  server_name example.com;
  return 301 https://$host$request_uri;
}

server {
  listen 443 ssl;
  http2 on;
  server_name example.com;

  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  add_header X-Content-Type-Options "nosniff" always;
  add_header Referrer-Policy "no-referrer" always;

  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

HSTS is useful after the certificate and the redirect are working. It is a commitment, not a decorative header. If a subdomain still speaks HTTP, `includeSubDomains` can turn a small configuration mistake into a long outage. I enable HSTS with the scope I can actually support, then widen it after verification.

Headers are a separate layer

Security headers are often grouped with TLS because they are configured in the same server block. They solve different problems. HSTS tells the browser to prefer HTTPS for a period of time. CSP limits which scripts and styles may run. `X-Content-Type-Options` stops content sniffing. `Referrer-Policy` controls what leaves the page in a request.

None of those headers replace authentication or validation. A page with a perfect CSP can still expose an admin action to the wrong user. A page with HSTS can still log a password in a request body.

Certificate renewal is a system

A certificate is not installed once and forgotten. It has an expiry date, a renewal job, a reload step and a failure mode. The failure is easy to postpone because the service keeps working until it does not.

I want the renewal path to be observable before the first expiry. Does the ACME client run? Can it write the challenge? Does the proxy reload after renewal? Does the deployed certificate actually change? Is there an alert before the remaining lifetime becomes uncomfortable?

curl -sSI https://example.com | head
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -dates -subject

Those checks tell me what the outside world sees. A local file with a valid certificate is not proof that the proxy is serving it.


Diagram of a browser, a TLS tunnel to a reverse proxy, an application and a database, with trust boundaries marked separately.
TLS protects the first leg. The application, its sessions and its data still need their own boundaries. Diagram created for this essay.

What TLS cannot do

It cannot tell whether a session belongs to the right person. It cannot decide whether an administrative action is authorized. It cannot make a SQL query safe. It cannot prevent a dependency from reading a secret. It cannot keep a backup private after the disk leaves the building.

Those are application and infrastructure decisions. They need tests, review and a clear owner. A certificate is one control among many, and most of the time it is the easiest one to verify. That makes it a poor proxy for the health of the rest.

What I check before calling it done

  • HTTP redirects to HTTPS before any content is served.
  • The certificate chain is complete and matches the requested host.
  • HSTS scope matches the domains that can actually support it.
  • The application is not directly reachable around the proxy.
  • Forwarded headers are only trusted from the proxy.
  • Renewal, reload and expiry monitoring have been exercised.
  • Authentication and authorization are tested separately from TLS.

TLS is a good lock on the connection. I still want to know who has the keys to the room, what is stored inside and what happens when someone leaves the door open.