Book 0 · Lesson 0.8
Web security primitives — TLS and mTLS
- Walk through TLS handshake at a high level
- Contrast HTTPS termination vs mTLS between services
- Locate dev certs in infra/certs/
Prerequisites: 0.4 · 0.7
TLS encrypts traffic and proves server identity. mTLS adds client certificates so backends only talk to known peers.
Team Radar Stage 2 uses both:
- Browser/gateway: HTTPS + JWT
- Gateway → ingestion/analyzer: mTLS on
:8083/:8084
1
ClientHello
Gateway proposes TLS 1.3 + cipher suites2
ServerHello + cert
Gateway presents dev cert (infra/certs/dev/gateway.crt)3
Client verifies chain
Trust local CA or skip verify in dev (-k)4
Client cert (mTLS)
Optional: gateway requires client.pem for backend hop5
Finished
Encrypted tunnel — JWT + HTTP inside TLS to :84436
mTLS to backend
Gateway opens rustls client to ingestion/analyzer :8083/:8084Dev cert bootstrap
bash infra/certs/generate-dev-certs.sh
MILLIPEDE_MTLS=1 pnpm gateway:dev
Read a cert:
openssl x509 -in infra/certs/dev/gateway.crt -text -noout | head -25
Full runbook: docs/stage2-gateway.md.
Teach-back prompt
Where is JWT checked vs where is the client certificate checked?
Read a cert chain
Lab complete — nice work.