Skip to content

feat(javanet): support Conscrypt security provider and PQC hybrid negotiation#2167

Draft
lqiu96 wants to merge 1 commit into
mainfrom
pqc-support-conscrypt
Draft

feat(javanet): support Conscrypt security provider and PQC hybrid negotiation#2167
lqiu96 wants to merge 1 commit into
mainfrom
pqc-support-conscrypt

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Adds fallback logic in NetHttpTransport to default to Conscrypt for SSLContext and fall back to the standard JDK TLS if Conscrypt is not available. Enables setting a custom security provider on the builder which takes precedence. Enforces PQC hybrid named groups (X25519MLKEM768, X25519) on Conscrypt sockets via a wrapped SSLSocketFactory.

@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label Jun 29, 2026
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch 5 times, most recently from 066bffb to 3497a47 Compare June 30, 2026 22:04
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch from 3497a47 to f4a7445 Compare July 7, 2026 19:38
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jul 7, 2026
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch 3 times, most recently from ac577db to 1e3ca17 Compare July 10, 2026 20:33
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Jul 10, 2026
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch 2 times, most recently from f738eaf to 33defc8 Compare July 10, 2026 20:44
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jul 10, 2026
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch 12 times, most recently from 7da5101 to e165b84 Compare July 10, 2026 21:13
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch 2 times, most recently from d150877 to d90f643 Compare July 13, 2026 16:24
@lqiu96 lqiu96 requested a review from blakeli0 July 13, 2026 16:25
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch from d90f643 to b4d0fb8 Compare July 13, 2026 18:44
if (securityProvider != null) {
return SSLContext.getInstance(TLS_ALGORITHM, securityProvider);
}
// 2. Default: Try Conscrypt (assumed to be available as part of SDK)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we always pass the Conscrypt provider in? So this library may not have to be dependent on Conscrypt?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think that is an option. Right now that's the intention of provided scope, library isn't dependent on Conscrypt and will only enable it by default if it's used via a library in the Java SDK

Conscrypt.setNamedGroups(sslSocket, groups);
return socket;
}
// 2. Otherwise (user-provided security provider or JDK fallback), try standard JSSE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this a case that we have to support? This is a generic http library and I don't think we have to try to enable PQC by default. As long as we expose an option and users (including GAPIC/Apiary libraries) can set the PQC algorithm then we should be good.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll double check the requirements. The earlier design mentioned that we will support PQC by default in the http-client. This functionality mirrors what gRPC-Java is doing which enables it by default (both being general purpose libraries)

@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch 3 times, most recently from 943111f to 55b200c Compare July 13, 2026 23:30
…ed groups configuration

TAG=agy
CONV=385b9ab5-874c-4c9a-b331-66dab51fef61
@lqiu96 lqiu96 force-pushed the pqc-support-conscrypt branch from 55b200c to 0f4489c Compare July 13, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants