Skip to content

Commit b236086

Browse files
committed
refactor(gax-httpjson): remove pqcNamedGroupsSupported flag and pass exception directly to log
1 parent c555d29 commit b236086

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ public class HttpJsonTransportUtils {
6969
* ensuring that setting Conscrypt as the default security provider does not cause breaking
7070
* failures for customers running on environments where Conscrypt is unsupported or unavailable.
7171
*/
72-
/**
73-
* Tracks whether Conscrypt supports PQC named groups. If configuration fails once, this is set to
74-
* false so subsequent socket connection attempts skip calling Conscrypt.setNamedGroups.
75-
*/
76-
private static volatile boolean pqcNamedGroupsSupported = true;
77-
7872
private static class ConscryptProviderHolder {
7973
private static final Provider INSTANCE = createProvider();
8074

@@ -107,7 +101,7 @@ public static NetHttpTransport.Builder configureConscryptSecurityProvider(
107101
.setSecurityProvider(conscryptProvider)
108102
.setSslSocketConfigurator(
109103
socket -> {
110-
if (!pqcNamedGroupsSupported || !Conscrypt.isConscrypt(socket)) {
104+
if (!Conscrypt.isConscrypt(socket)) {
111105
return;
112106
}
113107
try {
@@ -117,15 +111,10 @@ public static NetHttpTransport.Builder configureConscryptSecurityProvider(
117111
// ConscryptProviderHolder initialization. Catching Exception here safely
118112
// intercepts runtime socket configuration errors (e.g. unsupported groups or
119113
// closed socket) without swallowing JVM errors like OutOfMemoryError.
120-
pqcNamedGroupsSupported = false;
121114
LOG.log(
122115
Level.WARNING,
123-
"Failed to set PQC named groups on Conscrypt socket ("
124-
+ e.getClass().getName()
125-
+ ": "
126-
+ e.getMessage()
127-
+ "). Disabling PQC named groups and falling back to Conscrypt default TLS"
128-
+ " groups.",
116+
"Failed to set PQC named groups on Conscrypt socket. Falling back to Conscrypt"
117+
+ " default TLS groups.",
129118
e);
130119
}
131120
});

0 commit comments

Comments
 (0)