SSLContext.init throws NoClassDefFoundError on Android API 21-23 in 2.10.0
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 49/100
Hướng nghiên cứu
Start with SSLParametersImpl.unwrapTrustManager and getNetworkSecurityPolicyMethod, named in the stack trace, then inspect the new ConscryptEngineSocket$DelegatingTrustManager and the Android API level where its superclass became available. Reproduce with the linked API 21–23 project and compare behavior with 2.9.0. Done means SSLContext.init works on API 21–23 while retaining the intended security fix.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
SSLContext.init throws NoClassDefFoundError on Android API 21-23 in 2.10.0
Version: org.conscrypt:conscrypt-android:2.10.0 (2.9.0 works)
Affected: Android API 21-23 (tested on API 23, the class it needs arrived in API 24). Works on API 28.
Background
We support some older Android devices running API 21+. We use Conscrypt to improve their TLS support.
Problem
With 2.10.0, every SSLContext.init on the Conscrypt provider fails on API 21-23:
java.lang.NoClassDefFoundError: org.conscrypt.ConscryptEngineSocket$DelegatingTrustManager
at org.conscrypt.SSLParametersImpl.unwrapTrustManager(SSLParametersImpl.java:265)
at org.conscrypt.SSLParametersImpl.getNetworkSecurityPolicyMethod(SSLParametersImpl.java:272)
at org.conscrypt.SSLParametersImpl.<init>(SSLParametersImpl.java:174)
at org.conscrypt.OpenSSLContextImpl.engineInit(OpenSSLContextImpl.java:115)
at javax.net.ssl.SSLContext.init(SSLContext.java:349)
The first call reports Failed resolution of: Lorg/conscrypt/ConscryptEngineSocket$DelegatingTrustManager;.
Cause
ConscryptEngineSocket$DelegatingTrustManager, new in 2.10.0, extends javax.net.ssl.X509ExtendedTrustManager. Android added that class in API 24. SSLParametersImpl.<init> reaches it through getNetworkSecurityPolicyMethod → unwrapTrustManager on every init, whichever trust managers are passed, so the class can't be resolved on older devices. The AAR still declares minSdkVersion 21.
Reproduction
https://github.com/jordanbd/conscrypt-api23-repro
SSLContext context = SSLContext.getInstance("TLS", Conscrypt.newProvider());
context.init(null, null, null); // NoClassDefFoundError on API 21-23
| Device | 2.9.0 | 2.10.0 |
|---|---|---|
| API 23 emulator (6.0) | 4/4 pass | 3/4 fail, NoClassDefFoundError |
| rk3288_box device (5.1.1, API 22) | 4/4 pass | 3/4 fail, NoClassDefFoundError |
| API 28 emulator (9) | 4/4 pass | 4/4 pass |
Impact
Apps with minSdk below 24 that use Conscrypt for modern TLS can't create a Conscrypt SSLContext on those devices after upgrading. That leaves them stuck on 2.9.0, which is inside the affected range of the 2.10.0 security fix (GHSA-h3wp-2gww-26c4).
Whilst GHSA-h3wp-2gww-26c4 does not affect our usage of Conscrypt I would prefer to be able to patch if I can.
I have reviewed the release notes and can't see where the min SDK was bumped, so I was wondering if this was intentional? Android 21 is ridiculously old, so I understand if the library is moving on.
- Ngôn ngữ chính
- Java
- Star
- 1.4k
- Fork
- 332
- Merge trung bình
- 2 ngày 56 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/conscrypt
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 49/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Tất cả issue của google/conscrypt
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
new admin: minor issuesĐang mởadmin area
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
alfio-event/alf.io#1556 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
dependency-review: cross-line creation PRs trip the older line's pinned toolchain advisories (issue #30 allow-list, first instance)Có thể đã có người làm @Yash200531 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
HexaHexes/neoforge-mod-template#131 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày