concept

Certificate Pinning

Certificate pinning is a security technique used in client applications to prevent man-in-the-middle (MITM) attacks by ensuring that the server's SSL/TLS certificate matches a pre-defined, trusted certificate or public key. It involves hardcoding or storing the expected certificate or its fingerprint in the app, so the client verifies the server's identity against this pinned value during the TLS handshake. This adds an extra layer of security beyond standard certificate validation by Certificate Authorities (CAs).

Also known as: SSL Pinning, TLS Pinning, Public Key Pinning, HPKP, Certificate Validation
🧊Why learn Certificate Pinning?

Developers should implement certificate pinning in mobile apps, IoT devices, or any client-server applications where high security is critical, such as in banking, healthcare, or government systems, to mitigate risks from compromised CAs or rogue certificates. It is particularly useful in environments where users might connect to untrusted networks, as it prevents attackers from intercepting encrypted traffic using forged certificates. However, it requires careful management to avoid breaking the app if the server's certificate changes, so it's often combined with fallback mechanisms.

Compare Certificate Pinning

Learning Resources

Related Tools

Alternatives to Certificate Pinning