Skip to content

Java 8u261 added support for TLS1.3, avoid assuming otherwise #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions server/test/com/mirth/connect/util/MirthSSLUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@ public void testEnabledProtocols() throws Exception {
String[] enabledClientProtocols = MirthSSLUtil.getEnabledHttpsProtocols(defaultClientProtocols);
String[] enabledServerProtocols = MirthSSLUtil.getEnabledHttpsProtocols(defaultServerProtocols);

// TLSv1.3 supported in Java 11+
if (getJavaVersion() >= 11) {
assertTrue(ArrayUtils.contains(enabledClientProtocols, "TLSv1.3"));
assertTrue(ArrayUtils.contains(enabledServerProtocols, "TLSv1.3"));
} else {
assertFalse(ArrayUtils.contains(enabledClientProtocols, "TLSv1.3"));
assertFalse(ArrayUtils.contains(enabledServerProtocols, "TLSv1.3"));
}
// TLSv1.3 supported in Java 8u261+
assertTrue(ArrayUtils.contains(enabledClientProtocols, "TLSv1.3"));
assertTrue(ArrayUtils.contains(enabledServerProtocols, "TLSv1.3"));
}

@Test
Expand All @@ -47,12 +42,8 @@ public void testEnabledCipherSuites() throws Exception {

String[] enabledClientCipherSuites = MirthSSLUtil.getEnabledHttpsCipherSuites(defaultClientCipherSuites);

// TLS_AES_256_GCM_SHA384 supported in Java 11+
if (getJavaVersion() >= 11) {
assertTrue(ArrayUtils.contains(enabledClientCipherSuites, "TLS_AES_256_GCM_SHA384"));
} else {
assertFalse(ArrayUtils.contains(enabledClientCipherSuites, "TLS_AES_256_GCM_SHA384"));
}
// TLS_AES_256_GCM_SHA384 supported in Java 8u261+
assertTrue(ArrayUtils.contains(enabledClientCipherSuites, "TLS_AES_256_GCM_SHA384"));
}

private int getJavaVersion() {
Expand Down