Skip to content

Commit

Permalink
Add a test that verifies disabling of TLS 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Dec 13, 2023
1 parent 9227f7a commit 19bc31c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/test/java/io/vertx/core/http/HttpTLSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,46 @@ public void testTLSv1_3OpenSSL() throws Exception {
.serverEnabledSecureTransportProtocol(new String[]{"TLSv1.3"}).pass();
}

@Test
// Disable TLSv1.3
public void testDisableTLSv1_3() throws Exception {
Assume.assumeFalse(System.getProperty("java.version").startsWith("1.8"));
testTLS(Cert.NONE, Trust.NONE, Cert.SERVER_JKS, Trust.NONE).clientTrustAll()
.clientEnabledSecureTransportProtocol(new String[]{"TLSv1.3"})
.serverEnabledSecureTransportProtocol(new String[]{"TLSv1.2"})
.fail();
}

@Test
// Disable TLSv1.3 with OpenSSL
public void testDisableTLSv1_3OpenSSL() throws Exception {
testTLS(Cert.NONE, Trust.NONE, Cert.SERVER_JKS, Trust.NONE).clientTrustAll()
.clientEnabledSecureTransportProtocol(new String[]{"TLSv1.3"})
.serverEnabledSecureTransportProtocol(new String[]{"TLSv1.2"})
.serverOpenSSL()
.fail();
}

@Test
// Disable TLSv1.2
public void testDisableTLSv1_2() throws Exception {
Assume.assumeFalse(System.getProperty("java.version").startsWith("1.8"));
testTLS(Cert.NONE, Trust.NONE, Cert.SERVER_JKS, Trust.NONE).clientTrustAll()
.clientEnabledSecureTransportProtocol(new String[]{"TLSv1.2"})
.serverEnabledSecureTransportProtocol(new String[]{"TLSv1.3"})
.fail();
}

@Test
// Disable TLSv1.2 with OpenSSL
public void testDisableTLSv1_2OpenSSL() throws Exception {
testTLS(Cert.NONE, Trust.NONE, Cert.SERVER_JKS, Trust.NONE).clientTrustAll()
.clientEnabledSecureTransportProtocol(new String[]{"TLSv1.2"})
.serverEnabledSecureTransportProtocol(new String[]{"TLSv1.3"})
.serverOpenSSL()
.fail();
}

// SNI tests

@Test
Expand Down

0 comments on commit 19bc31c

Please sign in to comment.