Skip to content

Commit a9a7fb0

Browse files
committed
Get the list of enabled cipher suite for testing from the JDK
1 parent 254808c commit a9a7fb0

File tree

1 file changed

+14
-74
lines changed

1 file changed

+14
-74
lines changed

src/test/java/io/vertx/test/core/VertxTestBase.java

Lines changed: 14 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
import io.vertx.test.fakecluster.FakeClusterManager;
3030
import org.junit.Rule;
3131

32+
import javax.net.ssl.SSLContext;
33+
import javax.net.ssl.SSLSocketFactory;
34+
import java.security.NoSuchAlgorithmException;
3235
import java.util.ArrayList;
3336
import java.util.Collections;
3437
import java.util.List;
@@ -181,80 +184,17 @@ protected static void setOptions(TCPSSLOptions sslOptions, KeyCertOptions option
181184
}
182185
}
183186

184-
protected static final String[] ENABLED_CIPHER_SUITES =
185-
new String[] {
186-
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
187-
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
188-
"TLS_RSA_WITH_AES_128_CBC_SHA256",
189-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
190-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
191-
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
192-
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
193-
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
194-
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
195-
"TLS_RSA_WITH_AES_128_CBC_SHA",
196-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
197-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
198-
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
199-
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
200-
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
201-
"TLS_ECDHE_RSA_WITH_RC4_128_SHA",
202-
"SSL_RSA_WITH_RC4_128_SHA",
203-
"TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
204-
"TLS_ECDH_RSA_WITH_RC4_128_SHA",
205-
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
206-
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
207-
"TLS_RSA_WITH_AES_128_GCM_SHA256",
208-
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
209-
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
210-
"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
211-
"TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
212-
"TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
213-
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
214-
"SSL_RSA_WITH_3DES_EDE_CBC_SHA",
215-
"TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
216-
"TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
217-
"SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
218-
"SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
219-
"SSL_RSA_WITH_RC4_128_MD5",
220-
"TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
221-
"TLS_DH_anon_WITH_AES_128_GCM_SHA256",
222-
"TLS_DH_anon_WITH_AES_128_CBC_SHA256",
223-
"TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
224-
"TLS_DH_anon_WITH_AES_128_CBC_SHA",
225-
"TLS_ECDH_anon_WITH_RC4_128_SHA",
226-
"SSL_DH_anon_WITH_RC4_128_MD5",
227-
"TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
228-
"SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
229-
"TLS_RSA_WITH_NULL_SHA256",
230-
"TLS_ECDHE_ECDSA_WITH_NULL_SHA",
231-
"TLS_ECDHE_RSA_WITH_NULL_SHA",
232-
"SSL_RSA_WITH_NULL_SHA",
233-
"TLS_ECDH_ECDSA_WITH_NULL_SHA",
234-
"TLS_ECDH_RSA_WITH_NULL_SHA",
235-
"TLS_ECDH_anon_WITH_NULL_SHA",
236-
"SSL_RSA_WITH_NULL_MD5",
237-
"SSL_RSA_WITH_DES_CBC_SHA",
238-
"SSL_DHE_RSA_WITH_DES_CBC_SHA",
239-
"SSL_DHE_DSS_WITH_DES_CBC_SHA",
240-
"SSL_DH_anon_WITH_DES_CBC_SHA",
241-
"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
242-
"SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
243-
"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
244-
"SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
245-
"SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
246-
"SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
247-
"TLS_KRB5_WITH_RC4_128_SHA",
248-
"TLS_KRB5_WITH_RC4_128_MD5",
249-
"TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
250-
"TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
251-
"TLS_KRB5_WITH_DES_CBC_SHA",
252-
"TLS_KRB5_WITH_DES_CBC_MD5",
253-
"TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
254-
"TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
255-
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
256-
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5"
257-
};
187+
protected static final String[] ENABLED_CIPHER_SUITES;
188+
189+
static {
190+
String[] suites = new String[0];
191+
try {
192+
suites = SSLContext.getDefault().getSocketFactory().getSupportedCipherSuites();
193+
} catch (NoSuchAlgorithmException e) {
194+
e.printStackTrace();
195+
}
196+
ENABLED_CIPHER_SUITES = suites;
197+
}
258198

259199
/**
260200
* Create a worker verticle for the current Vert.x and return its context.

0 commit comments

Comments
 (0)