Skip to content
pubscout

ssl_pinning_plugin

2.0.0, released 6 years ago by an unverified publisher

Plugin to verify SSL pinning by comparing SHA-1 or SHA-256 fingerprints for HTTP requests.

WASM-readyRepository archived
$ flutter pub add ssl_pinning_plugin
Source repository

What it does

It checks that the server’s certificate fingerprint matches a known SHA‑1 or SHA‑256 value before allowing the request. The check is performed via a static method that returns a success or error string. It works on Android and iOS platforms.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to ensure a specific server’s certificate is trusted (SSL pinning).
  • You want a lightweight solution without pulling in a full networking stack.

Skip it when

  • You already use a networking library that provides built‑in pinning (e.g., dio).
  • You target web or desktop where the plugin has no implementation.
  • You require more advanced TLS features beyond simple fingerprint comparison.

Strengths

  • Simple, single‑method API
  • Supports both SHA‑1 and SHA‑256
  • Works on native Android and iOS

Weaknesses

  • Only supports pinning, no full HTTP client
  • No support for web/desktop platforms
  • May require native configuration and is not actively maintained

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
0

Add the plugin to pubspec, run flutter pub get, ensure Android embedding V2 and iOS deployment target >=9.0; no extra permissions required.

await SslPinningPlugin.check(serverURL: url, httpMethod: HttpMethod.Get, headerHttp: {}, sha: SHA.SHA1, allowedSHAFingerprints: ["AB:CD:..."], timeout: 50);

Alternatives

Packages that do the same job and could replace ssl_pinning_plugin.

  • dio

    Provides full HTTP client with optional certificate pinning and broader platform support.

  • http

    Lightweight HTTP client; pinning can be added via custom SecurityContext for more control.