Skip to content

feat(gax-httpjson): add global Conscrypt opt-out and preferred TLS provider auto-detection - #15428

Draft
lqiu96 wants to merge 5 commits into
googleapis:mainfrom
lqiu96:feat/gax-httpjson-conscrypt-opt-out
Draft

lqiu96 wants to merge 5 commits into
googleapis:mainfrom
lqiu96:feat/gax-httpjson-conscrypt-opt-out

Conversation

@lqiu96

@lqiu96 lqiu96 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

DRAFT/ WIP

Add a global opt-out for Conscrypt in HttpJsonConscryptUtils via the com.google.api.gax.httpjson.disableConscrypt system property or GOOGLE_SDK_JAVA_DISABLE_CONSCRYPT environment variable (system property takes precedence), and automatically skip Conscrypt when the JVM's preferred SSLContext.TLS provider is neither SunJSSE nor Conscrypt.

Also make HttpJsonConscryptUtils.getConscryptProvider() public (remaining @internalapi) for downstream transport follow-ups and document the global opt-out and preferred TLS provider behavior in docs/post_quantum_cryptography_guide.md.

Refs #15053

…ovider auto-detection

Add a global opt-out for Conscrypt in HttpJsonConscryptUtils via the
com.google.api.gax.httpjson.disableConscrypt system property or
GOOGLE_SDK_JAVA_DISABLE_CONSCRYPT environment variable (system property
takes precedence), and automatically skip Conscrypt when the JVM's
preferred SSLContext.TLS provider is neither SunJSSE nor Conscrypt.

Also make HttpJsonConscryptUtils.getConscryptProvider() public (remaining
@internalapi) for downstream transport follow-ups and document the global
opt-out and FIPS 140-3 configuration in docs/post_quantum_cryptography_guide.md.

Fixes googleapis#15053

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces configuration options to globally disable Conscrypt in gax-httpjson via the com.google.api.gax.httpjson.disableConscrypt system property or the GOOGLE_SDK_JAVA_DISABLE_CONSCRYPT environment variable. It also adds auto-detection to skip Conscrypt if a non-default preferred TLS provider is configured in the JVM. The documentation has been updated to reflect these changes, and comprehensive unit tests have been added. The review feedback suggests wrapping the system property, environment variable, and security provider lookups in try-catch blocks to gracefully handle potential SecurityExceptions in environments with restricted security managers.

…d tests

- Trim opt-out flag values, warn on unrecognized values, and avoid letting invalid system property values override GOOGLE_SDK_JAVA_DISABLE_CONSCRYPT=true
- Short-circuit config and preferred TLS provider checks, deduplicate skip/warning logs, and resolve the Conscrypt provider once in InstantiatingHttpJsonChannelProvider
- Fix ErrorProne DoubleBraceInitialization in HttpJsonConscryptUtilsTest, improve test isolation, and add mTLS and classloading opt-out coverage
- Clarify PQC guide minimum version (gax-httpjson 2.92.0+ / libraries-bom 26.95.0+), verification logs, BCJSSE snippet, gRPC asymmetry, and BigQuery JDBC follow-up note

This branch has not been deployed

No deployments
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