This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 043e912eaf Re-work fix to use existing Tomcat 9 approach - it is
cleaner
043e912eaf is described below
commit 043e912eaf7bb71b97378cfeb9ea4c55af61a8cd
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Jun 18 08:55:41 2026 +0100
Re-work fix to use existing Tomcat 9 approach - it is cleaner
---
.../tomcat/util/net/TestSslHandshakeFailure.java | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
b/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
index 0b0d49d69b..ba33e26bc1 100644
--- a/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
+++ b/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
@@ -26,7 +26,6 @@ import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLHandshakeException;
-import org.junit.Assert;
import org.junit.Test;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
@@ -78,24 +77,12 @@ public class TestSslHandshakeFailure extends TomcatBaseTest
{
sc.init(null, TesterSupport.getTrustManagers(), null);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
- Throwable actual = null;
try {
getUrl("https://localhost:" + getPort() + "/");
- } catch (Throwable t) {
- actual = t;
- }
-
- /*
- * SSLHandshakeException expected but SocketException has been observed
- */
- Assert.assertNotNull("No exception was thrown when
SSLHandshakeException was expected", actual);
-
- if (actual instanceof SSLHandshakeException || actual instanceof
SocketException) {
- // Tests passes = NO-OP
- } else {
- actual.printStackTrace();
- Assert.fail("Unexpected exception [" + actual.getClass() + ": " +
actual.getMessage() + "].");
+ } catch (SSLHandshakeException t) {
+ // Expected
+ } catch (SocketException e) {
+ // Expected - SocketException has also been observed (less often)
}
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]