Skip to content

Compile java-http-client with public crypto release#6

Open
RomeoApps wants to merge 2 commits into
lqhuang:mainfrom
RomeoApps:codex/public-crypto-compile-fix
Open

Compile java-http-client with public crypto release#6
RomeoApps wants to merge 2 commits into
lqhuang:mainfrom
RomeoApps:codex/public-crypto-compile-fix

Conversation

@RomeoApps

Copy link
Copy Markdown

This updates the helper java-http-client module to compile against the public scala-native-crypto 0.3.0 release and the current curl/OpenSSL APIs.

Why:

What changed:

  • Move scala-native-crypto to public 0.3.0.
  • Update curl option/info constants and callback signatures to the current generated APIs.
  • Keep KeyStore-backed client certificate initialization explicit as unsupported instead of relying on removed dirty-snapshot internals.
  • Adjust the related compile test to assert that unsupported boundary.

Validation:

  • git diff --check
  • ./mill -i modules.java-http-client.compile
  • ./mill -i modules.java-http-client.test.compile
  • Public patch apply was also checked against a fresh clone.

Known limit:

  • Full native test execution is still blocked on my local machine by missing OpenSSL headers (openssl/ssl.h), so this PR is scoped to restoring clean compile/test-compile and making the unsupported client-certificate path explicit.

@RomeoApps

Copy link
Copy Markdown
Author

Validation update: I reran the native compile/link locally with OpenSSL 3.5.0 provided via CPATH, LIBRARY_PATH, DYLD_LIBRARY_PATH, and PKG_CONFIG_PATH. The previous openssl/ssl.h blocker is gone: modules.java-http-client.test.compile and modules.java-http-client.test.nativeLink complete successfully, and the native linker now links [pthread, dl, m, crypto, curl, ssl].

I also ran a focused non-network smoke slice:

modules.java-http-client.test.testOnly snhttp.test.java.net.CookieHandlerTest snhttp.test.java.net.CookieManagerTests snhttp.test.java.net.http.HttpClientBuilderTest

Result: Tests: 45, Passed: 45, Failed: 0.

I’m not claiming the full modules.java-http-client.test suite is green yet: after link it reaches HttpClientTest and appears to hang in the existing HTTP request loop, so I stopped that run rather than over-reporting it. The compile/link issue this PR targets is now validated locally.

@RomeoApps

Copy link
Copy Markdown
Author

Follow-up pushed in 8aa963b.

What changed:

  • fixed the curl multi wait loop so it stops once the multi handle reports no running transfers, instead of polling forever after completion;
  • decoded the CURLMSG_DONE payload from the pointer-sized union slot before mapping libcurl result codes, so invalid-host and unreachable-port paths now become ConnectException;
  • made client KeyManager registration fail explicitly as unsupported, and adjusted the unsupported-boundary test so it no longer depends on unavailable KeyStore.getInstance.

Validation with the same local OpenSSL 3.5.0 include/lib/pkg-config paths:

  • git diff --check
  • modules.java-http-client.test.testOnly snhttp.test.java.net.http.HttpClientTest -> Tests: 5, Passed: 5, Failed: 0
  • previous non-network smoke slice -> Tests: 45, Passed: 45, Failed: 0
  • modules.java-http-client.test -> Tests: 463, Passed: 463, Failed: 0

This is still not a full Requests-Scala bounty claim from this PR alone; it makes the helper PR green locally and removes the previous HttpClientTest hang/full-suite blocker.

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