Repository navigation
Handle Cronet by re-enabling pinning bypass for local trust anchors - #234
Merged
Merged
Conversation
pimterry
reviewed
Sep 18, 2026
Cronet (Chromium's network stack, used by many Google apps, gRPC and other SDKs) runs TLS in native code and ignores the JVM proxy, OkHttp and TrustManager layers, so none of the existing unpinning hooks affect it. It trusts locally-installed CAs by default, but only while public-key-pinning bypass for local trust anchors is left enabled, which an app can turn off with a single CronetEngine.Builder call. Hook enablePublicKeyPinningBypassForLocalTrustAnchors to always pass true, so our injected CA is accepted while pinning stays intact for connections chaining to a real (non-local) trust anchor - matching the "disable only the extra restrictions" approach the other hooks take.
az-xx
force-pushed
the
cronet-pinning-bypass
branch
from
September 18, 2026 11:45
0b8cf35 to
939a596
Compare
Member
|
That's perfect, thanks @az-xx! Merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Cronet — Chromium's network stack, used by many Google apps, gRPC and various other SDKs — runs TLS itself in native code and ignores the JVM proxy, OkHttp and
TrustManagerlayers entirely, so none of the existing hooks inandroid-certificate-unpinning.jsaffect it.Cronet does trust locally-installed CAs by default, but only while public-key-pinning bypass for local trust anchors is left enabled. An app can turn that off with a single builder call:
…after which even a user/admin-installed CA (like the one this toolkit injects) can no longer intercept its connections.
The fix
Hook
org.chromium.net.CronetEngine$Builder.enablePublicKeyPinningBypassForLocalTrustAnchorsto always passtrue, regardless of what the app requested, and return the builder so chaining keeps working.This follows the same philosophy as the surrounding hooks — it disables only the extra restriction (pinning layered on top of a locally-trusted CA), so the injected CA is accepted while pinning stays fully intact for connections that chain to a real, non-local trust anchor.
addPublicKeyPinsis deliberately left untouched for that reason.Notes
PINNING_FIXES.org.chromium.netAPI (CronetEngine.Builder).