Skip to content

Commit eb7a664

Browse files
Copilotchrjohn
andcommitted
Use comprehensive cipher suite list for Windows JDK 21 compatibility
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
1 parent 253e491 commit eb7a664

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

quickfixj-core/src/test/java/quickfix/mina/ssl/SSLCertificateTest.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ public class SSLCertificateTest {
8080

8181
private static final String LOCALHOST_ALIAS = "localhost-quickfixj";
8282

83+
// Cipher suites that require certificates (excludes anonymous suites)
84+
// This list provides compatibility across different JDK versions and platforms
85+
private static final String CERTIFICATE_REQUIRED_CIPHER_SUITES = String.join(",",
86+
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
87+
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
88+
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
89+
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
90+
"TLS_RSA_WITH_AES_128_GCM_SHA256",
91+
"TLS_RSA_WITH_AES_256_GCM_SHA384",
92+
"TLS_RSA_WITH_AES_128_CBC_SHA256",
93+
"TLS_RSA_WITH_AES_256_CBC_SHA256",
94+
"TLS_RSA_WITH_AES_128_CBC_SHA",
95+
"TLS_RSA_WITH_AES_256_CBC_SHA",
96+
"TLS_AES_128_GCM_SHA256",
97+
"TLS_AES_256_GCM_SHA384"
98+
);
99+
83100
@Parameters
84101
public static List<Object[]> parameters() {
85102
return Arrays.asList(new String[][]{{"TLS_RSA_WITH_AES_128_CBC_SHA", "TLSv1.2"}, {"TLS_AES_256_GCM_SHA384", "TLSv1.3"}});
@@ -794,13 +811,13 @@ public void shouldFailIndividualSessionsWhenInvalidCertificatesUsed() throws Exc
794811
public void shouldFailWhenUsingEmptyServerKeyStore() throws Exception {
795812
int freePort = AvailablePortFinder.getNextAvailable();
796813
TestAcceptor acceptor = new TestAcceptor(createAcceptorSettings("single-session/empty.keystore", false,
797-
"single-session/empty.keystore", enabledCipherSuites, enabledProtocols, "JKS", "JKS", freePort));
814+
"single-session/empty.keystore", CERTIFICATE_REQUIRED_CIPHER_SUITES, "TLSv1.2,TLSv1.3", "JKS", "JKS", freePort));
798815

799816
try {
800817
acceptor.start();
801818

802819
TestInitiator initiator = new TestInitiator(createInitiatorSettings("single-session/empty.keystore",
803-
"single-session/empty.keystore", enabledCipherSuites, enabledProtocols, "ZULU", "ALFA", Integer.toString(freePort), "JKS", "JKS"));
820+
"single-session/empty.keystore", CERTIFICATE_REQUIRED_CIPHER_SUITES, "TLSv1.2,TLSv1.3", "ZULU", "ALFA", Integer.toString(freePort), "JKS", "JKS"));
804821

805822
try {
806823
initiator.start();

0 commit comments

Comments
 (0)