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 d942de3bc4 Refactor to use new SSLHostConfig instance for each test
d942de3bc4 is described below

commit d942de3bc418044a32931a83cf17df0664604be1
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Nov 9 11:52:27 2023 +0000

    Refactor to use new SSLHostConfig instance for each test
    
    Random crashes have been observed on some platforms. This is intended to
    create greater isolation between tests.
---
 test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java 
b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
index d84c0b56a9..cbfbef6f57 100644
--- a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
+++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
@@ -74,8 +74,6 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest {
     @Parameter(3)
     public StoreType storeType;
 
-    private SSLHostConfig sslHostConfig = new SSLHostConfig();
-
 
     @Test
     public void testHostEC() throws Exception {
@@ -244,6 +242,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
 
 
     private void configureHostRSA() {
+        SSLHostConfig sslHostConfig = getSSLHostConfig();
         switch (storeType) {
         case KEYSTORE: {
             SSLHostConfigCertificate sslHostConfigCertificateRsa = new 
SSLHostConfigCertificate(sslHostConfig, Type.RSA);
@@ -263,6 +262,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
 
 
     private void configureHostEC() {
+        SSLHostConfig sslHostConfig = getSSLHostConfig();
         switch (storeType) {
         case KEYSTORE: {
             SSLHostConfigCertificate sslHostConfigCertificateEc = new 
SSLHostConfigCertificate(sslHostConfig, Type.EC);
@@ -312,6 +312,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
         connector.setScheme("https");
         connector.setSecure(true);
         Assert.assertTrue(connector.setProperty("SSLEnabled", "true"));
+        SSLHostConfig sslHostConfig = new SSLHostConfig();
         sslHostConfig.setProtocols("TLSv1.2");
         connector.addSslHostConfig(sslHostConfig);
 
@@ -331,6 +332,13 @@ public class TestSSLHostConfigCompat extends 
TomcatBaseTest {
     }
 
 
+    private SSLHostConfig getSSLHostConfig() {
+        Tomcat tomcat = getTomcatInstance();
+        Connector connector = tomcat.getConnector();
+        return connector.findSslHostConfigs()[0];
+    }
+
+
     private static String getPath(String relativePath) {
         File f = new File(relativePath);
         return f.getAbsolutePath();


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

Reply via email to