Target & Proxy Parameters
Auto-updates on keystrokeCalculated SPKI Base64 Hash
DynamicChange this to any custom sha256 base64 pin, or use the automated one-liner below to calculate it live in bash without manual typing.
--pinnedpubkey "sha256//<BASE64_HASH>".
Curl checks the Subject Public Key Info (SPKI) rather than the entire leaf cert.
Automated Single Bash Command
Extracts the SPKI pin directly from abc.com into a subshell variable, then runs both direct & proxy verification!
Extract SPKI SHA-256 Base64 Fingerprint
Connects to remote server, extracts SubjectPublicKeyInfo and hashes it
Direct Connection with Pinning Enforced
Curl will verify the server's public key matches the sha256 pin (Expected: HTTP 200/Success)
Proxied Connection (Squid SSL-Bump / Interception)
Standard CA trust succeeds via squidCA.crt, but pin check detects MITM key (Expected: SSL pinning failure / curl error 90)
Full Executable Bash Script (`test_pinning.sh`)
Clean, commented bash script with colored terminal output and automatic validation
What is SPKI Pinning?
Subject Public Key Info (SPKI) pinning binds connections to the cryptographic public key itself instead of the entire certificate. When renewing certificates, keeping the same private key preserves the pin.
Why Squid Fails the Pin
Squid SSL-Bump intercepts traffic by generating a dynamic certificate on-the-fly signed by squidCA.crt. Even though Curl trusts the CA, the dynamically generated key does not match the pinned public key hash.
Expected Curl Exit Code
When pinning is violated, Curl terminates handshake with curl: (90) SSL: public key does not match pinned public key!, protecting clients from unauthorized interception.