@@ -94,6 +94,7 @@ public class ConnectionFipsIT extends AbstractDriverIT {
94
94
"javax.net.ssl.trustStoreType" ;
95
95
private static final String JAVA_SYSTEM_PROPERTY_SSL_PROTOCOLS = "jdk.tls.client.protocols" ;
96
96
private static final String JAVA_SYSTEM_PROPERTY_SSL_CIPHERSUITES = "jdk.tls.client.cipherSuites" ;
97
+ private static final String JAVA_SYSTEM_PROPERTY_SSL_NAMEDGROUPS = "jdk.tls.namedGroups" ;
97
98
98
99
private static String JAVA_SYSTEM_PROPERTY_SSL_KEYSTORE_TYPE_ORIGINAL_VALUE ;
99
100
private static String JAVA_SYSTEM_PROPERTY_SSL_TRUSTSTORE_TYPE_ORIGINAL_VALUE ;
@@ -108,6 +109,8 @@ public class ConnectionFipsIT extends AbstractDriverIT {
108
109
@ BeforeAll
109
110
public static void setup () throws Exception {
110
111
System .setProperty ("javax.net.debug" , "ssl" );
112
+ // Setting up the named group to avoid test failure on GCP environment.
113
+ System .setProperty (JAVA_SYSTEM_PROPERTY_SSL_NAMEDGROUPS , "secp256r1, secp384r1, ffdhe2048, ffdhe3072" );
111
114
// get keystore types for BouncyCastle libraries
112
115
JAVA_SYSTEM_PROPERTY_SSL_KEYSTORE_TYPE_ORIGINAL_VALUE =
113
116
System .getProperty (JAVA_SYSTEM_PROPERTY_SSL_KEYSTORE_TYPE );
@@ -207,7 +210,8 @@ public static void teardown() throws Exception {
207
210
JAVA_SYSTEM_PROPERTY_SSL_TRUSTSTORE_TYPE_ORIGINAL_VALUE );
208
211
}
209
212
System .clearProperty (SecurityUtil .ENABLE_BOUNCYCASTLE_PROVIDER_JVM );
210
-
213
+ // clear the named group.
214
+ System .clearProperty (JAVA_SYSTEM_PROPERTY_SSL_NAMEDGROUPS );
211
215
// attempts an SSL connection to Google
212
216
// connectToGoogle();
213
217
}
@@ -291,10 +295,8 @@ public void testConnectUsingKeyPair() throws Exception {
291
295
292
296
/**
293
297
* Test case for connecting with FIPS and executing a query.
294
- * Currently ignored execution on GCP due to exception thrown "SSlException Could not generate XDH keypair"
295
298
*/
296
299
@ Test
297
- @ DontRunOnGCP
298
300
public void connectWithFipsAndQuery () throws SQLException {
299
301
try (Connection con = getConnection ()) {
300
302
Statement statement = con .createStatement ();
0 commit comments