Interview Prep/Networking/Containers, Kubernetes, IPv6 and packet captures

Requests fail intermittently with a 400 in production only, and you need to see the HTTP payload inside the TLS connection between your service and its upstream.

AdvancedTroubleshootingContainers, Kubernetes, IPv6 and packet captures
Answer

Likely causes → You can't read TLS 1.3 traffic from a capture with just the server's private key (forward secrecy). You need the per-session secrets from one of the endpoints.

Diagnose →

# 1. make the client log session keys (supported by curl, OpenSSL-based apps that honour it, Firefox/Chrome, Go via tls.Config.KeyLogWriter)
export SSLKEYLOGFILE=/tmp/tls-keys.log
# 2. capture at the same time
sudo tcpdump -ni eth0 -w /tmp/tls.pcap host upstream.example.com and port 443
# 3. decrypt
tshark -r /tmp/tls.pcap -o tls.keylog_file:/tmp/tls-keys.log -Y http -V | less

Alternatively, add a debug log of request headers at the client, or route through a mitm proxy in staging.

Fix → Once decrypted, you usually find the real cause: a malformed header, a duplicated Content-Length, a missing Host/SNI, or a body encoding mismatch.

Prevent → Treat key log files as secrets: enable briefly, protect, and delete afterwards. Add structured request/response logging (with redaction) at service boundaries so you rarely need decryption.

All Networking questions Roadmap: Networking for DevOps

More on Containers, Kubernetes, IPv6 and packet captures