This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new ba7fd15e45 Refactor to use new SSLHostConfig instance for each test ba7fd15e45 is described below commit ba7fd15e45d31059514b49be34e14c80f1c5d25e 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 b6a94f1bc8..0a1f5736d4 100644 --- a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java +++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java @@ -71,8 +71,6 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest { @Parameter(3) public StoreType storeType; - private SSLHostConfig sslHostConfig = new SSLHostConfig(); - @Test public void testHostEC() throws Exception { @@ -241,6 +239,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest { private void configureHostRSA() { + SSLHostConfig sslHostConfig = getSSLHostConfig(); switch (storeType) { case KEYSTORE: { SSLHostConfigCertificate sslHostConfigCertificateRsa = new SSLHostConfigCertificate(sslHostConfig, Type.RSA); @@ -260,6 +259,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest { private void configureHostEC() { + SSLHostConfig sslHostConfig = getSSLHostConfig(); switch (storeType) { case KEYSTORE: { SSLHostConfigCertificate sslHostConfigCertificateEc = new SSLHostConfigCertificate(sslHostConfig, Type.EC); @@ -309,6 +309,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); @@ -321,6 +322,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