Skip to content

Commit 3a10d5c

Browse files
committed
docs(http): update Conscrypt PQC Javadoc comments and method naming
1 parent d98c348 commit 3a10d5c

3 files changed

Lines changed: 10 additions & 16 deletions

File tree

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonTransportUtils.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ public class HttpJsonTransportUtils {
5151
*
5252
* <ul>
5353
* <li>{@code X25519MLKEM768}: Primary preferred hybrid key exchange algorithm combining
54-
* Curve25519 ECDHE with NIST FIPS 203 (ML-KEM-768 / Kyber768), selected as the primary
55-
* group per Google Cloud PQC guidelines.
54+
* Curve25519 ECDHE with NIST FIPS 203 (ML-KEM-768 / Kyber768).
5655
* <li>{@code SecP256r1MLKEM768}: Secondary preferred hybrid key exchange algorithm combining
5756
* NIST P-256 (SecP256r1) with NIST FIPS 203 (ML-KEM-768) for environments requiring
5857
* FIPS-compliant elliptic curves.
@@ -69,8 +68,6 @@ public class HttpJsonTransportUtils {
6968
* <p>This static nested class defers Conscrypt {@link Provider} creation until first access and
7069
* caches the resulting instance (or {@code null} if Conscrypt native JNI libraries fail to load).
7170
*
72-
* <p>Design rationale:
73-
*
7471
* <ul>
7572
* <li><b>Thread Safety</b>: Leverages JVM class-loading guarantees to initialize the singleton
7673
* thread-safely without requiring synchronized blocks or locks.
@@ -96,18 +93,15 @@ private static Provider createProvider() {
9693
}
9794

9895
/**
99-
* Creates a {@link NetHttpTransport.Builder} pre-configured with Conscrypt security provider and
100-
* PQC named groups if Conscrypt is available.
96+
* Creates a {@link NetHttpTransport.Builder} pre-configured with Conscrypt as the security
97+
* provider by default.
10198
*
102-
* <p>Tradeoff Decision: We intentionally catch errors and gracefully fall back to JDK TLS or
103-
* Conscrypt defaults rather than failing fast. Because Conscrypt depends on native JNI libraries
104-
* that may not be available or compatible across all user environments (e.g. non-x86
105-
* architectures, musl libc, custom runtimes), failing fast would cause breaking outages for
106-
* existing customers upgrading the SDK. We accept the tradeoff of a potential silent fallback to
107-
* classical TLS (logged at WARNING level) in exchange for maintaining high availability and
108-
* backward compatibility across all client environments.
99+
* <p>Note: Conscrypt native JNI libraries may not be available or compatible across all
100+
* environments. If Conscrypt is not available, transport creation gracefully falls back to the
101+
* default JDK TLS provider. Users can customize the {@link NetHttpTransport.Builder} or security
102+
* provider if needed.
109103
*/
110-
public static NetHttpTransport.Builder createPqcHttpTransportBuilder() {
104+
public static NetHttpTransport.Builder createConscryptHttpTransportBuilder() {
111105
NetHttpTransport.Builder builder = new NetHttpTransport.Builder();
112106
Provider conscryptProvider = ConscryptProviderHolder.INSTANCE;
113107
if (conscryptProvider == null) {

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public TransportChannelProvider withCredentials(Credentials credentials) {
205205
}
206206

207207
HttpTransport createHttpTransport() throws IOException, GeneralSecurityException {
208-
NetHttpTransport.Builder builder = HttpJsonTransportUtils.createPqcHttpTransportBuilder();
208+
NetHttpTransport.Builder builder = HttpJsonTransportUtils.createConscryptHttpTransportBuilder();
209209
return configureMtls(builder).build();
210210
}
211211

sdk-platform-java/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public HttpTransport create() {
6969
}
7070
}
7171

72-
return HttpJsonTransportUtils.createPqcHttpTransportBuilder().build();
72+
return HttpJsonTransportUtils.createConscryptHttpTransportBuilder().build();
7373
}
7474
}
7575

0 commit comments

Comments
 (0)