This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new abb9d6fe01 Fix TLS test with Tomcat Native
abb9d6fe01 is described below

commit abb9d6fe01ad6f6140ea6d4ddcaf03c3601c5283
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 1 18:11:31 2024 +0100

    Fix TLS test with Tomcat Native
---
 test/org/apache/tomcat/util/net/TestClientCertTls13.java | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/TestClientCertTls13.java 
b/test/org/apache/tomcat/util/net/TestClientCertTls13.java
index 4ccbc594d6..5f8555b1c8 100644
--- a/test/org/apache/tomcat/util/net/TestClientCertTls13.java
+++ b/test/org/apache/tomcat/util/net/TestClientCertTls13.java
@@ -28,6 +28,8 @@ import org.junit.runner.RunWith;
 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;
@@ -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;
     }
@@ -69,6 +71,9 @@ public class TestClientCertTls13 extends TomcatBaseTest {
     @Parameter(2)
     public String sslImplementationName;
 
+    @Parameter(3)
+    public boolean initSslImplementation;
+
 
     @Test
     public void testClientCertGet() throws Exception {
@@ -110,6 +115,11 @@ public class TestClientCertTls13 extends TomcatBaseTest {
         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);
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to