Lion Cipher Lab

Wrap a plaintext TCP service in TLS with stunnel

Why it matters

A huge amount of software still speaks plaintext over the network. Old internal tools, databases left on their default settings, homegrown line-based daemons, industrial and appliance protocols — they send usernames, session tokens, query results and secrets as readable text across the wire. Anyone who can watch that wire (a compromised switch, a rogue device on the LAN, a curious admin, an attacker who already has a foothold) can read all of it, and often change it, without breaking anything or leaving an obvious trace. The clean fix is TLS — the same encryption that protects HTTPS — but you…

What you'll learn

Steps in this lab

  1. The problem: plaintext over TCP, in one breath
  2. When stunnel is the right tool — and when it is NOT
  3. Stand up the plaintext service (a Redis in Docker)
  4. BEFORE: capture the secret travelling in the clear
  5. Make a certificate: one openssl command
  6. Write the stunnel config: accept, connect, and two ends
  7. AFTER: capture the same secret — now it's ciphertext
  8. The honest limits: encryption is not authentication, and only the hop is covered
  9. What you did — and why it sticks

Open the full interactive lab →