Skip to content
Free lab

Certificate Pinning Lab

Certificate pinning fails on rotation, not on the day you turn it on. Publish a set of SPKI public-key pins, then rotate the server’s key — and watch the apps that update slowly hard-fail TLS because they still enforce the old pins. The lab drills the one habit that makes pinning survivable: pre-publish a backup key’s pin before you need it. Rotate with zero breakage, reject the mis-issued and stolen-key chains, and keep a clean backup for next time — and you pass.

The real job. More noise, a tighter clock.

0sPro

Goal

The fleet pinned only Leaf A’s key. Roll the certificate over without locking out apps that update slowly — and set up a safety net so the NEXT rotation can actually change the key.

Published pin set (SPKI pins you ship to clients)

sha256/9Qx4mZ1bK3p0r7T2uVwX8yA5cDeFgHiJkLmNoPqRs=

Rotation

Rotate the live leaf onto

Server then presents: leaf A → intermediate → root CA

Client populations (each enforces the last pin set it downloaded)

Web / short sessionspins leaf Aleaf A
Mobile app · quarterly updatespins leaf Aleaf A
Embedded devices · yearlypins leaf Aleaf A

Score vs goal

Edit the pin set and rotation, then validate. So far 0 fleet(s) would break and 0 attacker chain(s) are trusted.

Legend

A client survives only if its pinned set shares an SPKI with the new chain.

Amber pin — CA/intermediate (no breakage, but trusts all its certs).

Red pin — a compromised key you are still pinning.

Pre-publish a backup key’s pin before you need it — that is the whole discipline.

Live arena

4 active
adversary kill-chain1/4
pinning-you (you)100%
mobile-eng-lee17%
pki-lead-sam10%
sre-mara9%

adversary staging…

TL;DR

What this lab is

  • A free, browser-based certificate-pinning lab: publish a set of SPKI (public-key) pins, then rotate the server’s key without hard-failing the apps that already trust the old pins.
  • Pinning is validated client-side against the newest pin set a client has downloaded — so slow-updating fleets still enforce an older set, which is exactly what breaks naive rotations.
  • The one discipline the lab drills: pre-publish a backup key’s pin BEFORE you rotate, so the next key is already trusted when it goes live.
  • Trade-offs are made concrete: pin the leaf (tight, but fragile to rotation), pin the intermediate/CA (rotates freely, but trusts every cert that CA issues), keep a pre-published backup (zero-downtime rotation).
  • Scored on zero client breakage plus rejecting mis-issued and stolen-key chains; difficulty adds slower fleets, frozen builds and compromise events.

Frequently asked questions

What is the Certificate Pinning Lab?

A free, in-browser exercise where you configure a set of SPKI public-key pins for an app and then rotate the server’s certificate/key, watching how deployed client populations react. Each client enforces the most recent pin set it has downloaded; a connection succeeds only if the presented certificate chain shares at least one pinned public key with that set. You are scored on rotating with zero client breakage while still rejecting mis-issued or stolen-key chains.

Why does pinning the leaf key break rotation?

If clients pin only the current leaf’s public key and you rotate to a new key, every client still enforcing the old pin will refuse the new certificate — the new key is not in their pinned set. Because slow-updating apps may hold that old set for months, you cannot safely change the key until the new key’s pin has already reached them. The fix is to pre-publish a backup key’s pin in an earlier release, or to renew the certificate while keeping the same key (the SPKI is unchanged).

What is a backup pin and why pre-publish it?

A backup pin is the SPKI of a key you have generated in advance (typically kept offline) but are not yet serving. Shipping its pin ahead of time means that when you later rotate the live key onto it, every client that updated in the meantime already trusts it — so the rotation causes no breakage. Pre-publishing the next key’s pin before the key goes live is the core habit of safe pinning, and it is what lets a key-compromise emergency be survivable instead of fatal.

Is this a real TLS stack?

No. It is a teaching model of SPKI pin validation (match any pinned public key in the presented chain) and update-lag across client populations. It deliberately ignores certificate expiry handling, OCSP/CRL revocation, HSTS and the exact HPKP/mobile-SDK encodings so the one lesson — pin the right thing and pre-publish the next key — is clear. The keys, pins and scenarios are invented.

🎉 New here? Use code WELCOME10 for 10% off any plan at checkout
Certificate Pinning Lab — Free SPKI Pinning & Rotation Trainer · PlayCISO