Skip to content

SSL Certificate Pinning using flutter #16066

@long1eu

Description

@long1eu

I want to add a trusted certificate to my HttpClient, but this is not very efficient. Certificates expire so I want to pin the public key. Is there a way to do this in dart/flutter?

Activity

us3soap

us3soap commented on May 29, 2018

@us3soap

We publish a plugin : https://pub.dartlang.org/packages/ssl_pinning_plugin to check pinning with fingerprint (SHA-1).

jamespet77

jamespet77 commented on Aug 2, 2018

@jamespet77

Is this available yet? Documentation?

us3soap

us3soap commented on Aug 2, 2018

@us3soap

It's operational, we are writing the documentation for the release.

jamespet77

jamespet77 commented on Aug 2, 2018

@jamespet77

That would be great. So you have a new release for the 0.5.7 beta? It doesn't seem to be compatible with the latest flutter beta. getting error:

The current Flutter SDK version is 0.5.7.

Because ssl_pinning_plugin requires Flutter SDK version ^0.4.4, version solving failed.

zoechi

zoechi commented on Aug 2, 2018

@zoechi
Contributor

dart-lang/sdk#33115 mentions that this is now fixed in Flutter
Can anyone confirm?

added
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Aug 2, 2018
long1eu

long1eu commented on Aug 2, 2018

@long1eu
Author

yes it works

removed
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Aug 2, 2018
zoechi

zoechi commented on Aug 2, 2018

@zoechi
Contributor

Great! Thanks for the update @long1eu 👍

giaur500

giaur500 commented on Feb 8, 2019

@giaur500

Well, as I can see, only sha1 is supported. This is a shame, sha1 is very weak. Any thoughts to add sha256? Sha1 is not even worth

zoechi

zoechi commented on Feb 10, 2019

@zoechi
Contributor

@giaur500 please create a feature request in https://github.com/dart-lang/sdk/issues

sandeepcmsm

sandeepcmsm commented on Feb 18, 2019

@sandeepcmsm

@zoechi @mit-mit thanks for certficate pinning support. Can the SecurityContext validate a public key instead of a certificate? This is more future proof as certificate pinning comes with issues of certificate expiry. or can X509Certificate include public key sha256 signature. Since most of native apps are build on public key pinning. This has become one major blockage for our client. Can we reopen the current issue and dart-lang/sdk#33115 . since there has not been any activity on dart sdk issue from months.

pa1more

pa1more commented on Jun 6, 2019

@pa1more

Is this issue resolved for SHA2 certificates ?

I used webview in my application and it stopeed after i installed ssl on my server.

mleonhard

mleonhard commented on Sep 26, 2019

@mleonhard
Contributor

The ssl_pinning_plugin makes its own HTTPS request and checks the certificate. It does not check certificates used by the app's real requests. I see no way to accomplish that with the plugin. This means that apps using the plugin are still vulnerable to MITM.

Edit: I requested a fix in macif-dev/ssl_pinning_plugin#3 .

github-actions

github-actions commented on Aug 27, 2021

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

locked as resolved and limited conversation to collaborators on Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jamespet77@zoechi@mleonhard@sandeepcmsm@pa1more

        Issue actions

          SSL Certificate Pinning using flutter · Issue #16066 · flutter/flutter