certificate pinning for WebViews in Android 4.4

688 views
Skip to first unread message

Gabor Matuz

unread,
Sep 29, 2014, 8:57:29 AM9/29/14
to chromi...@chromium.org
Hi there,

I'm working on an Android app and as added security I'd like to use certificate pinning. For earlier version there was a hackish version with private reflection on the TrustManager but I see that now all those parts are handled by native code. Is there a way to still pin certificates in webviews?

Cheers,
Gabor

Primiano Tucci

unread,
Sep 29, 2014, 11:17:41 AM9/29/14
to mat...@gmail.com, Chromium-discuss, sgu...@chromium.org
-chromium-dev +chromium-discuss

I don't think WebView support overriding the TrustManager either. Also, yes, reflection speculating on the internal architecture of framework components / non public API sounds a pretty bad idea. It might work on a particular version of Android, but it might break on some others or on other devices.

It might not be exactly what you are looking for, but what about achieving something very similar to certificate pinning on the app-side with webview.getCertificate()?
Unfortunately the version of WebView in 4.4 doesn't seem to support public key pinning (HPKP) which probably would have been the best solution for what you are looking for.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Deepak D

unread,
Aug 3, 2015, 7:45:46 AM8/3/15
to Chromium-dev
Hi all,

I am working on an Android app and I have to add pinning certificate within this app. I am using Webview for displaying website. Here I want use pinning certificate with their(website) public key.. please provide some sample code for this concept.

Thanks ,
Deepak D

Selim Gurun

unread,
Aug 4, 2015, 1:43:35 PM8/4/15
to Chromium-dev, deepakd....@gmail.com
We do not support this at the time, sorry.
Reply all
Reply to author
Forward
0 new messages