Skip to content

docs: Add a Http/Json Post-Quantum Cryptography Guide - #13963

Draft
lqiu96 wants to merge 6 commits into
mainfrom
pqc-user-guide
Draft

docs: Add a Http/Json Post-Quantum Cryptography Guide#13963
lqiu96 wants to merge 6 commits into
mainfrom
pqc-user-guide

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jul 30, 2026

Copy link
Copy Markdown
Member

No description provided.

@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 a comprehensive Post-Quantum Cryptography (PQC) User Guide for HTTP/JSON Java Client Libraries. The guide details the quantum threat, library support, Conscrypt integration, platform compatibility, and custom configurations. The review feedback correctly identifies that NetHttpTransport.Builder lacks a setSecurityProvider method in the custom configuration example and provides a valid code suggestion to configure an SSLContext with the custom provider instead.

Comment on lines +214 to +221
// Step 2: Configure NetHttpTransport with custom security provider and SSLSocketConfigurator
NetHttpTransport customTransport =
new NetHttpTransport.Builder()
.setSecurityProvider(customProvider)
.setSslSocketConfigurator(
socket -> {
// Configure custom SSLSocket options (e.g., cipher suites, protocols, or named groups)
})

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.

medium

NetHttpTransport.Builder does not have a setSecurityProvider method. To use a custom security provider, you should configure an SSLContext with the custom provider and set the SSLSocketFactory on the builder.

Suggested change
// Step 2: Configure NetHttpTransport with custom security provider and SSLSocketConfigurator
NetHttpTransport customTransport =
new NetHttpTransport.Builder()
.setSecurityProvider(customProvider)
.setSslSocketConfigurator(
socket -> {
// Configure custom SSLSocket options (e.g., cipher suites, protocols, or named groups)
})
javax.net.ssl.SSLContext sslContext;
try {
sslContext = javax.net.ssl.SSLContext.getInstance("TLS", customProvider);
sslContext.init(null, null, null);
} catch (Exception e) {
throw new RuntimeException("Failed to initialize SSLContext with custom provider", e);
}
NetHttpTransport customTransport =
new NetHttpTransport.Builder()
.setSslSocketFactory(sslContext.getSocketFactory())
.setSslSocketConfigurator(
socket -> {
// Configure custom SSLSocket options (e.g., cipher suites, protocols, or named groups)
})
.build();

Comment thread docs/post_quantum_cryptography_guide.md Outdated

If your environment cannot load native Conscrypt libraries or cannot configure PQC groups, the library emits a concise, one-line warning at `Level.WARNING` and safely falls back to standard JDK TLS:
```
WARNING: Conscrypt native libraries not available. Falling back to JDK TLS.

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.

What actions can customers take to remove this warning?

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.

From online, some ways to remove/ resolve (some examples from a non-exhaustive list):

  • add a C compat RUN apk add --no-cache gcompat libc6-compat
  • swap from alphin to another distro with glibc compat
  • Set java.io.tmpdir to an executable directory
  • Set the Conscrypt-specific temporary directory (org.conscrypt.tmpdir)

depends on the environment and if they can run this. some of these may be not possible for each user

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.

Thanks! Is this documented somewhere from 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.

Not from Conscrypt documentation. It's what I've found from searching what others have done resolve common issues from musl/ Alpine and non-exec dirs from docker/ kube restrictions

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.

2 participants