Skip to content

docs: Add gRPC Post-Quantum Cryptography Guide - #14245

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

docs: Add gRPC Post-Quantum Cryptography Guide#14245
lqiu96 wants to merge 36 commits into
mainfrom
pqc-user-guide-grpc

Conversation

@lqiu96

@lqiu96 lqiu96 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

This pull request expands the Post-Quantum Cryptography (PQC) User Guide in docs/post_quantum_cryptography_guide.md to cover gRPC transport in addition to HTTP/JSON.

This PR is stacked on top of PR #13963 (pqc-user-guide).

Highlights

  • General PQC Architecture: Updates the guide to introduce PQC concepts, the Store-Now, Decrypt-Later (SNDL) threat model, and hybrid key exchange across Google Cloud Java client libraries.
  • Dedicated gRPC Transport Section (Section 3):
    • Details the default grpc-netty-shaded transport engine bundling BoringSSL (netty-tcnative-boringssl-static) with built-in PQC hybrid key exchange support (X25519MLKEM768) in gRPC-Java 1.83.0+.
    • Explains handshake negotiation with Google Cloud Front End (GFE) endpoints and graceful fallback to classical TLS.
    • Explains gRPC HTTP/2 long-lived multiplexed channels (ManagedChannel) and how TLS overhead occurs once upon connection establishment.
  • Verification (Section 7):
    • Explains why standard JVM -Djavax.net.debug flags do not capture gRPC handshakes when using grpc-netty-shaded.
    • Documents Netty SSL debug logging (-Dio.grpc.netty.shaded.io.netty.handler.ssl=DEBUG) and ClientInterceptor response header verification.
  • Custom Configurations (Section 8):
    • Documents custom Netty SSL context configuration via InstantiatingGrpcChannelProvider.Builder.setChannelConfigurator(...).

… steps and locally scoped security providers
- Frame PQC concepts with beginner-friendly explanations and the two-lock hybrid analogy.
- Clarify transport scope: focus exclusively on HTTP/JSON transport and note gRPC coverage in a future PR.
- Document handshake size overhead (~1-2KB) and negligible runtime API latency impact due to connection pooling.
- Detail deployment compatibility matrix covering glibc Linux, Alpine/musl fallback, and hardened noexec /tmp filesystems.
- Add prominent warning on silent fallback tradeoff between high availability and strict regulatory compliance.
- Provide step-by-step verification instructions using GAX debug logs and JVM -Djavax.net.debug=ssl:handshake output.
- Present modular, non-prescriptive configuration choices (default Conscrypt, classical-only X25519, pure JDK JSSE, dependency exclusion, and custom Bouncy Castle provider).
- Add future outlook on OpenJDK native ML-KEM support in JDK 27+.
- Add Wikipedia link to Shor's algorithm.
- Remove conversational introductory phrasing in threat section.
- Frame hybrid key exchange as an example rather than a standard.
- Remove redundant audience phrasing and generalize endpoint references.
- Remove gRPC transport scope section to keep guide focused on HTTP/JSON.
- Add OpenJDK link to JEP 496.
- Align default named groups list with DEFAULT_CONSCRYPT_NAMED_GROUPS in gax-httpjson.
- Clarify fallback to configured security provider (defaulting to standard JDK JSSE).
- Moderate latency assertions and encourage user benchmarking.
- Remove unsubstantiated CPU benchmark assertions.
- Neutralize Alpine Linux options and suggest alternative security providers like Bouncy Castle.
- Clean up custom configuration options to only include actionable alternative setups.
@lqiu96
lqiu96 requested review from a team as code owners September 2, 2026 18:39
@lqiu96
lqiu96 marked this pull request as draft September 2, 2026 18:39

@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 expands the Post-Quantum Cryptography (PQC) User Guide to cover both gRPC and HTTP/JSON transports, adding comprehensive sections on gRPC transport architecture, platform compatibility, verification methods, and custom configurations. The review feedback suggests correcting the Netty SSL logging instructions to configure the logging framework directly rather than using a JVM system property, and removing an unused import in the gRPC configuration code snippet.

Comment thread docs/post_quantum_cryptography_guide.md Outdated
Comment on lines +328 to +333
#### Method 1: Netty SSL Debug Logging
You can enable debug logging for Netty's shaded SSL handler to observe TLS handshake details:

```bash
java -Dio.grpc.netty.shaded.io.netty.handler.ssl=DEBUG -jar my-application.jar
```

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

Netty's logging is routed through its InternalLoggerFactory, which delegates to the application's active logging framework (such as SLF4J/Logback, Log4j2, or java.util.logging). Passing -Dio.grpc.netty.shaded.io.netty.handler.ssl=TRACE as a JVM system property will not configure the log level. Instead, the log level for the shaded package io.grpc.netty.shaded.io.netty.handler.ssl must be set to TRACE (or FINEST for JUL) within the application's logging configuration file to ensure TLS handshake details are visible.

For example, in a logging.properties file (JUL):

io.grpc.netty.shaded.io.netty.handler.ssl.level=FINEST

Or in a Logback configuration (logback.xml):

<logger name="io.grpc.netty.shaded.io.netty.handler.ssl" level="TRACE"/>
Suggested change
#### Method 1: Netty SSL Debug Logging
You can enable debug logging for Netty's shaded SSL handler to observe TLS handshake details:
```bash
java -Dio.grpc.netty.shaded.io.netty.handler.ssl=DEBUG -jar my-application.jar
```
#### Method 1: Netty SSL Trace Logging
You can enable trace logging for Netty's shaded SSL handler to observe TLS handshake details by configuring your logging framework (such as JUL, Logback, or Log4j2) to set the log level for the package "io.grpc.netty.shaded.io.netty.handler.ssl" to TRACE (or FINEST).
References
  1. When providing logging examples, use the logging level that will actually show the desired logs, even if it's a more verbose level like FINEST, rather than a less verbose level like FINE, if the actual logs are at the more verbose level.

Comment thread docs/post_quantum_cryptography_guide.md Outdated
import com.google.cloud.secretmanager.v1.SecretManagerServiceSettings;
import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
import java.io.File;

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

The import java.io.File is not used in this code snippet and can be safely removed to keep the example clean.

Base automatically changed from pqc-user-guide to main September 5, 2026 01:07
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