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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new dd09bad579 Fix potential test failure
dd09bad579 is described below

commit dd09bad57945d42d90ddd2e2d2de743484d37fc9
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Jan 19 15:53:07 2026 +0000

    Fix potential test failure
---
 test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java 
b/test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java
index e3034ac956..0744b094f3 100644
--- a/test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java
+++ b/test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java
@@ -16,6 +16,8 @@
  */
 package org.apache.tomcat.util.net.ocsp;
 
+import java.net.SocketException;
+
 import javax.net.ssl.SSLHandshakeException;
 
 import org.junit.AfterClass;
@@ -60,6 +62,15 @@ public class TestOcspTimeout extends OcspBaseTest {
 
     @Test(expected = SSLHandshakeException.class)
     public void testTimeoutWithoutSoftFail() throws Exception {
-        doTest(false, false, ClientCertificateVerification.ENABLED, false, 
Boolean.FALSE);
+        try {
+            doTest(false, false, ClientCertificateVerification.ENABLED, false, 
Boolean.FALSE);
+        } catch (SocketException se) {
+            // NIO2 may throw a SocketException rather than a 
SSLHandshakeException
+            if 
(getTomcatInstance().getConnector().getProtocolHandlerClassName().contains("Nio2"))
 {
+                throw new SSLHandshakeException(se.getMessage());
+            } else {
+                throw se;
+            }
+        }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to