Skip to content

Commit

Permalink
Fix TLS test with Tomcat Native
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Jul 1, 2024
1 parent d3a18ee commit e88233a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/org/apache/tomcat/util/net/TestClientCertTls13.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;

import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.core.AprStatus;
import org.apache.catalina.startup.Tomcat;
Expand All @@ -51,11 +53,11 @@ public class TestClientCertTls13 extends TomcatBaseTest {
public static Collection<Object[]> parameters() {
List<Object[]> parameterSets = new ArrayList<>();
parameterSets.add(new Object[] {
"JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation"});
"JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation", Boolean.FALSE});
parameterSets.add(new Object[] {
"OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation"});
"OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation", Boolean.TRUE});
parameterSets.add(new Object[] {
"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"});
"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation", Boolean.FALSE});

return parameterSets;
}
Expand All @@ -69,6 +71,9 @@ public static Collection<Object[]> parameters() {
@Parameter(2)
public String sslImplementationName;

@Parameter(3)
public boolean initSslImplementation;


@Test
public void testClientCertGet() throws Exception {
Expand Down Expand Up @@ -110,6 +115,11 @@ public void setUp() throws Exception {
TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL);

if (useOpenSSL) {
// getOpenSSLVersion() requires that the listener has been initialised
if (initSslImplementation) {
tomcat.getServer().findLifecycleListeners()[0].lifecycleEvent(
new LifecycleEvent(tomcat.getServer(), Lifecycle.BEFORE_INIT_EVENT, null));
}
Assume.assumeTrue(AprStatus.getOpenSSLVersion() >= 0x1010100f || OpenSSLStatus.getVersion() >= 0x1010100f);
}

Expand Down

0 comments on commit e88233a

Please sign in to comment.