Skip to content

chore: upgrade okhttp to 4.12.0 - #21

Open
Vligai wants to merge 1 commit into
mainfrom
chore/okhttp3-upgrade
Open

chore: upgrade okhttp to 4.12.0#21
Vligai wants to merge 1 commit into
mainfrom
chore/okhttp3-upgrade

Conversation

@Vligai

@Vligai Vligai commented Aug 16, 2026

Copy link
Copy Markdown

com.squareup.okhttp 2.7.5 is end of life with no further releases. Move to com.squareup.okhttp3 4.12.0, the last line supporting the Java 8 target.

  • drop the unused logging-interceptor dependency
  • ApiClient: okhttp3 imports, RequestBody.create argument order, and HttpUrl.get instead of parse so a malformed base URL throws rather than hitting a null pointer
  • add ApiClientTest covering the four verbs, headers, query params, error bodies and TLS hostname verification via MockWebServer, so the transport layer has coverage without credentials
  • run ApiClientTest in the credential-free docker compose target

Breaking: ApiClient.getClient() now returns okhttp3.OkHttpClient.

com.squareup.okhttp 2.7.5 is end of life with no further releases. Move to
com.squareup.okhttp3 4.12.0, the last line supporting the Java 8 target.

- drop the unused logging-interceptor dependency
- ApiClient: okhttp3 imports, RequestBody.create argument order, and
  HttpUrl.get instead of parse so a malformed base URL throws rather than
  hitting a null pointer
- add ApiClientTest covering the four verbs, headers, query params, error
  bodies and TLS hostname verification via MockWebServer, so the transport
  layer has coverage without credentials
- run ApiClientTest in the credential-free docker compose target

Breaking: ApiClient.getClient() now returns okhttp3.OkHttpClient.
@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-java-sdk-21-chore-upgrade-okhttp-to-4-12-0

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

The PR migrates the SDK transport from the end-of-life OkHttp 2.x API to OkHttp 4.12.0 and adds credential-free transport tests.

  • Updates OkHttp coordinates, imports, request-body construction, and URL parsing.
  • Removes the unused logging interceptor.
  • Adds MockWebServer coverage for HTTP verbs, headers, parameters, errors, and TLS verification.
  • Includes the new transport tests in the Docker Compose unit-test target.

Confidence Score: 5/5

The PR appears safe to merge, with no changed-code-triggered blocking or actionable non-blocking issues identified.

The OkHttp migration preserves the transport behavior covered by the new tests, rejects malformed URLs more explicitly, and does not introduce a new reachable SSRF or vulnerable dependency path.

Important Files Changed

Filename Overview
pom.xml Upgrades OkHttp to 4.12.0, removes the old interceptor, and adds test-scoped MockWebServer and TLS dependencies without introducing a reachable dependency vulnerability.
src/main/java/com/infisical/sdk/api/ApiClient.java Migrates transport APIs to okhttp3 while preserving request behavior and replacing nullable malformed-URL parsing with an explicit exception.
src/test/java/com/infisical/sdk/api/ApiClientTest.java Adds focused local-server coverage for requests, responses, authentication headers, error handling, and TLS hostname and trust validation.
docker-compose.yaml Adds ApiClientTest to the credential-free unit-test command.

Reviews (1): Last reviewed commit: "chore: upgrade okhttp to 4.12.0" | Re-trigger Greptile

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