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 55d447ff44 Align with 9.0.x
55d447ff44 is described below

commit 55d447ff44a5664c3da6264b0903f487d4ec328a
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Feb 9 14:14:50 2026 +0000

    Align with 9.0.x
    
    Better handles failure modes with some newer versions of Java
---
 test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFail.java | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFail.java 
b/test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFail.java
index 382db3838b..699a808ddd 100644
--- a/test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFail.java
+++ b/test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFail.java
@@ -18,6 +18,7 @@ package org.apache.tomcat.util.net.ocsp;
 
 import java.net.SocketException;
 
+import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLHandshakeException;
 
 import org.junit.Test;
@@ -47,13 +48,10 @@ public class TestOcspSoftFail extends OcspBaseTest {
     public void testNoResponderWithoutSoftFail() throws Exception {
         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;
-            }
+        } catch (SocketException | SSLException e) {
+            // APR or NIO2 may throw a SocketException rather than a 
SSLHandshakeException
+            // Different Java versions may throw an SSLException rather than a 
SSLHandshakeException
+            throw new SSLHandshakeException(e.getMessage());
         }
     }
 }


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

Reply via email to