Skip to content

--story=134453973 【安全】Java SDK okhttp 存在安全漏洞#277

Open
likeelli wants to merge 3 commits into
TencentCloud:masterfrom
likeelli:feature/java8-okhttp4-upgrade
Open

--story=134453973 【安全】Java SDK okhttp 存在安全漏洞#277
likeelli wants to merge 3 commits into
TencentCloud:masterfrom
likeelli:feature/java8-okhttp4-upgrade

Conversation

@likeelli

Copy link
Copy Markdown
Contributor

No description provided.

likeelli added 3 commits June 16, 2026 11:04
- Bump maven-compiler-plugin source/target from 1.7 to 1.8
- Bump okhttp and logging-interceptor from 3.12.13 to 4.12.0
- Add jaxb-api 2.3.0 (required by okhttp 4.x on Java 8)
- Update RequestBody.create() call order to (body, mediaType) per okhttp 4.x API
- Remove deprecated single-arg setSSLSocketFactory() in HttpConnection (removed in okhttp 4.x)
- In AbstractClient.trySetSSLSocketFactory(), fall back to JVM default X509TrustManager
  when only SSLSocketFactory is set, preserving backward compatibility for existing callers

CVE fixed:
  CVE-2021-0341 (CVSS 7.5 High): TLS hostname verification bypass in okhttp < 4.9.1
  CVE-2023-3635 (CVSS 5.3 Medium): GzipSource resource leak in okhttp < 4.10.0
8 test cases covering:
  TC1 - POST TC3-HMAC-SHA256 (default path)
  TC2 - GET HmacSHA256 (legacy signature)
  TC3 - GET TC3-HMAC-SHA256
  TC4 - POST HmacSHA1 (legacy signature)
  TC5 - Custom SSLSocketFactory + X509TrustManager (okhttp4 two-arg API)
  TC6 - SSLSocketFactory only, no TrustManager (backward compat fallback)
  TC7 - Custom HostnameVerifier
  TC8 - Explicit HTTPS protocol
@likeelli likeelli force-pushed the feature/java8-okhttp4-upgrade branch from bf1d679 to d3239a8 Compare June 17, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant