Skip to main content
miji.be

Certificate Pinning

A security technique in which an application pins the TLS certificates it trusts in advance, then detects and rejects fake certificates substituted through man-in-the-middle attacks.

Oct 31, 2026 / About 1 min read

Security

Certificate pinning is a security technique in which an application pins the TLS certificate (or public key) of the server it communicates with in advance and rejects the connection if the certificate presented at connection time does not match the pinned value. It is used as a countermeasure against man-in-the-middle attacks (MITM) that use fake certificates issued by rogue certificate authorities.

As implementation examples in mobile apps, on iOS you specify the hash of the certificate's public key in a URLSession delegate method, and on Android in Network Security Config. In a short URL app, if a MITM attack occurs while the redirect destination is being retrieved, there is a risk that users will be led to a malicious site.

HTTP Public Key Pinning (HPKP) was once standardized for web browsers, but Google has announced that it will remove HPKP in Chrome 72, citing low usage and risks such as denial of service. Certificate Transparency (CT) is a mechanism that records issued certificates in public logs so that improper issuance can be detected.

An operational challenge of certificate pinning is that an app update is required when certificates are rotated. Setting backup pins or pinning at the intermediate certificate level can lessen the impact of rotation.

For short URL services, another approach is to combine certificate pinning to protect API communication with CT log monitoring to detect improperly issued certificates.

Was this article helpful?

Related Terms

SSL/TLS

Cryptographic protocols that provide secure communication over the internet by encrypting data between client and server.

Certificate Transparency

A framework for monitoring and auditing SSL/TLS certificates to detect misissued or fraudulent certificates.

Man-in-the-Middle Attack

A cyberattack in which an attacker intercepts communication between two parties to eavesdrop on or tamper with data. HTTPS adoption has driven countermeasures forward.

HSTS

HTTP Strict Transport Security - a header that forces browsers to only connect to a website using HTTPS.

HTTPS

The secure version of HTTP that encrypts data transmitted between a browser and a web server using TLS.

QR Code Security

Measures to protect users from malicious QR codes that may lead to phishing sites or malware downloads.

Related Articles

Short URL Security - Phishing Risks, Safe Sharing Practices, and Protection Guide

A comprehensive guide to short URL security. Understand phishing risks, malware distribution via shortened links, and best practices for safe sharing.

What Happens When You Click a Link? A Peek Behind the 0.5-Second Curtain

What happens behind the scenes when you click a link? An adventure-style guide covering DNS, requests, responses, and how URL shortener redirects work.

Short URL Phishing - How to Spot Scams and Protect Yourself from Malicious Links

Learn to identify phishing attacks that use short URLs. Covers 5 common scam patterns, URL preview tools, and practical defense strategies.

Put the terms to work

Shorten a URL for Free