Application security feature

Mobile app certificate pinning

When certificate pinning fits a mobile app, and how Otukan pins sensitive connections with backup keys and a rotation plan that keeps renewals routine.

  • Android
  • iOS
  • Flutter
  • React Native
Intercepted API traffic is met at the pinned trust boundary before it reaches the appIntercepted API trafficPinned trustYour app
  • Pin where it pays

    Otukan pins the connections that carry sign-in, payment and account data, and leaves low-risk traffic to standard TLS validation.

  • Rotation built in

    Backup pins, expiry handling and a recovery path ship with the first pinned release, so renewing a certificate stays a routine task.

  • Pinning that stays on

    Runtime checks catch the hooking used to switch pinning off, and your backend hears about it.

Interception scenarios Otukan addresses

Select a scenario to see how Otukan's pinning reacts, what the user experiences and what your team learns.

Added trust anchors

  1. Detect

    A pinned connection rejects a server certificate chained to an authority that a user, a profile or an attacker added to the device.

  2. Respond

    The request is not sent, so credentials do not reach the interceptor.

  3. Report

    A pin mismatch is recorded with the domain and platform.

Hostile network proxy

  1. Detect

    Traffic routed through a proxy that re-signs connections fails the pin check for the protected domains.

  2. Respond

    The app shows a clear connection message instead of failing silently.

  3. Report

    Your security team sees which domains and platforms saw interception attempts, and how often.

Mis-issued certificate

  1. Detect

    A certificate that is publicly valid but carries a key you did not declare does not match the pin set.

  2. Respond

    The connection is refused for pinned domains only.

  3. Report

    The mismatch is logged, giving your team an early sign of a misissuance or misconfiguration.

Pinning switched off

  1. Detect

    Runtime checks detect hooking and patched network code aimed at disabling the pin check.

  2. Respond

    Sensitive flows are restricted, per your policy.

  3. Report

    A bypass signal travels to your backend with the session.

Planned rotation

  1. Detect

    The app accepts the current key or any declared backup key, so a planned change needs no emergency release.

  2. Respond

    Users keep connecting while the next release refreshes the pin set.

  3. Report

    Mismatch reports by domain and platform show your team whether the change landed cleanly.

What Otukan pinning provides

Pinning, lifecycle management and the checks that keep pinning honest.

  • Public-key pinning

    Pins the key behind your certificates rather than a single certificate file, so routine renewals with the same key pass.

  • Mismatch reporting

    Records pin failures by domain and platform for your mobile team and certificate owner, so attacks and misconfiguration are told apart quickly.

  • Per-domain scope

    Applies pinning only to the domains you choose, leaving analytics, content delivery and third-party calls alone.

  • Anti-tampering

    Confirms code and signing identity match your release, so a copy rebuilt with pinning stripped out is recognised before it connects.

  • Man-in-the-middle prevention

    Adds proxy, interception and network context to the pinning decision.

  • Connection hardening

    Tightens TLS settings on the client so weak protocols and downgrade paths stay closed.

How pinning is rolled out

  1. Choose the domains

    List the endpoints that carry credentials, payments or personal data.

  2. Declare backup keys

    Agree primary and standby keys, and the expiry policy, with whoever owns your certificates.

  3. Ship the pinned build

    Pinning is applied within your normal build and release flow; signing keys remain yours.

  4. Rehearse a rotation

    Switch to a backup key in a test environment and confirm installed builds keep connecting.

  5. Monitor mismatches

    Watch pin failures by domain and platform to separate attacks from misconfiguration.

Free for app publishers

Check your app's exposure

A passive review of your published app by an Otukan engineer. No files, no access to your systems. Findings go by email to the verified publisher.

You finish the request on the next page.

Certificate pinning fits when an app talks to servers you control, carries data worth intercepting and has a team that can plan certificate changes. It makes the app trust only the keys you declared for those domains, so connections through a proxy, an added trust anchor or a mis-issued certificate are refused for those domains. The risk is an outage when a certificate changes. Otukan pins selected domains, ships backup keys and an expiry policy from the first release, rehearses rotation with your team and detects attempts to switch pinning off. Pinning is one layer, not a full network security design.

When pinning fits

Platform guidance

Android’s developer guidance warns against routine pinning because an unplanned certificate change can lock out installed apps. On Android, apps targeting recent platform versions already ignore user-added certificate authorities unless they opt in, which removes one common interception route. On iOS, a user can install a configuration profile and explicitly trust its root, and apps can declare pinned keys for chosen domains. Otukan configures each platform on its own terms.

Threat model

Pinning earns its place when the attacker is on the network path or has convinced the user to trust a new root, and the traffic carries credentials, payment data or account changes. It adds little when the endpoint belongs to a third party whose certificates you cannot track.

Alternatives and companions

SituationBetter fitWhy
Endpoints you own, high-value trafficPublic-key pinning with backup keysStrong control over which server the app trusts
Third-party endpoints you do not manageStandard TLS validationYou cannot plan their certificate changes
Worry about scripts calling your API directlyApp attestation and API signalsPinning does not prove the caller is your app
Worry about a tampered app removing checksRuntime integrityPinning inside a modified app can be removed

Network interception more broadly is covered on man-in-the-middle attack prevention.

Pin lifecycle

An outage from pinning is almost always a lifecycle failure. Otukan treats the lifecycle as part of the feature.

  1. Primary and backup keys. Every pinned domain has at least one standby key held separately, so a compromised or expiring key has a ready replacement.
  2. Rotation. Your certificate owner moves to a backup key; installed apps keep connecting, and the next release adds a new standby.
  3. Expiry. The pin set carries an expiry policy, so an app that is never updated does not stay locked to keys from years ago.
  4. Recovery. A written plan covers the case where every declared key must change, agreed before the first release.
  5. Rehearsal. A rotation is tested in a non-production environment before the pinned build ships.

Who owns what

Pinning outages usually start with a handover gap: the mobile team ships pins, while a platform or infrastructure team renews certificates on its own schedule. Otukan’s rollout names both owners from the start. The certificate owner confirms which keys are primary and which are standby, and agrees to warn the mobile team before any key change. The mobile team confirms which app versions carry which pin set. Pin mismatch reports then go to both teams, so an unexpected change is noticed by the people who can fix it, not by users who cannot sign in. Frameworks add one more question. Flutter and React Native apps often use their own networking layers, so Otukan confirms that pinning covers the path each framework actually uses on each platform.

For the step-by-step procedure, see the certificate pinning rotation guide.

Three separate checks

Pinning is often confused with checks that sit next to it. Keeping them apart makes each one easier to reason about.

CheckQuestion it answersWhere it runsWhat defeats it on its own
TLS validationIs the certificate valid for this host and accepted by the platform?Operating system network stackA trusted but hostile root on the device
PinningIs this the key I declared for this domain?App, for pinned domainsCode in a modified app that disables the check
Runtime integrityIs the app running as shipped, without hooks or patches?App, reported to your backendAn attacker hiding hooks on a device they control, which is why your server weighs the signal with others

Used together, validation confirms the chain, pinning confirms the server and runtime integrity confirms the pin check itself is still in place. Pinning sits alongside the other controls covered on mobile app security.

Common questions

  • Does Android recommend certificate pinning?

    Android's developer guidance advises caution with pinning, because a server certificate change can cut off installed apps that no longer match. That advice is about unplanned pinning. Otukan pins only the domains where interception would cost you most, and ships backup keys and an expiry policy with every pinned domain, the safeguards Android's documentation describes for apps that do pin.

  • Is pinning enough to secure our app's traffic?

    Pinning answers one question: is this the server I expect. It sits on top of standard TLS validation, which checks the certificate chain and host name, and beside runtime integrity, which keeps pinning from being switched off. Server-side checks such as attestation and session signals remain part of a sound design.

  • What happens if a certificate has to change without warning?

    If the new certificate uses a declared backup key, installed apps keep connecting. That is why Otukan requires standby keys before the first pinned release. The recovery plan agreed with your team covers the rarer case where every declared key must change, so users are not left stranded.

  • Should we pin the certificate, the key or the issuing authority?

    Pinning the public key is usually the best balance: renewals with the same key pass, and a different key triggers a mismatch. Pinning an issuing authority is looser but survives more changes. Otukan helps you choose per domain, based on who manages the certificates and how often they change.

On the mobile engineering team?

How protection fits your build, signing and release, platform by platform.

Pin with a plan, not a gamble

Tell us the platform, the framework, the domains your app talks to and who manages their certificates. We do not ask for private keys, certificates, binaries or production credentials.

Or request a technical demo