`CertificateVerifier.verifyCertificateChain` on Android can cause `NetworkOnMainThreadException`
还没有人认领这个 Issue。
- #259 来自 @FrankenApps —— 已关闭,未合并
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- mobile-dev, security
调研方向
Start with CertificateVerifier.kt at the linked verifyCertificateChain implementation around line 182, then trace how rustls-platform-verifier-android 0.2.0 invokes it. Reproduce the revocation-check path that raises NetworkOnMainThreadException and inspect how results return to the Rust library. Done means certificate verification no longer performs network work on Android's main thread and still reports its result correctly.
由索引模型根据 Issue 内容生成。
描述
After migrating to 0.2.0 for the rustls-platform-verifier-android dependency in our project and adapting our code to it, we realised sometimes the certification verification failed with some Revoked errors and then after a while it fixed itself.
What we consistently saw in the logs were NetworkOnMainThreadException whenever this happened. It turns out the request was done by Rust in a different thread, but then the verification is done in the main thread. As that code under the hood opens URL connections, the Android system interprets that as a 'no network requests on main thread' rule violation and the revocation checks fail.
Could this verification step can be moved to a coroutine or a different thread and provide the results via a callback to the Rust library to ensure it never runs in the main thread?
- 主要语言
- Rust
- 星标
- 162
- 派生
- 67
- 平均合并
- 5 天 14 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rustls/rustls-platform-verifier 的其他 Issue
-
O-Android
难度 5/5 一周以上 新手友好度 12/100
rustls/rustls-platform-verifier#260 · 4 条评论 ·
-
O-Android
难度 3/5 1-2 天 新手友好度 43/100
rustls/rustls-platform-verifier#247 · 4 条评论 ·
-
Windows: revocation check blocks up to 10s with no effect on verification outcome可能已有人在做 @djc 于 130 天前认领。 未关闭O-Windows
难度 4/5 3-5 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 55/100
rustls/rustls-platform-verifier#230 · 2 条评论 ·
-
O-Android
难度 3/5 1-2 天 新手友好度 45/100
rustls/rustls-platform-verifier#228 · 3 条评论 ·
查看 rustls/rustls-platform-verifier 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 65/100
pop-os/cosmic-settings#2296 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
jonathanong/no-mistakes#3431 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
Ephemeral-AI-Lab/layerfs#689 ·
维护者通常 1 天内回复