This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new f6a7ce87dc Refactor to use new SSLHostConfig instance for each test
f6a7ce87dc is described below
commit f6a7ce87dceac3e0b87bb08c5044b0caa09462ae
Author: Mark Thomas <[email protected]>
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 bc824a0456..6939f5b0bd 100644
--- a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
+++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
@@ -76,8 +76,6 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest {
@Parameter(3)
public StoreType storeType;
- private SSLHostConfig sslHostConfig = new SSLHostConfig();
-
@Test
public void testHostEC() throws Exception {
@@ -246,6 +244,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest
{
private void configureHostRSA() {
+ SSLHostConfig sslHostConfig = getSSLHostConfig();
switch (storeType) {
case KEYSTORE: {
SSLHostConfigCertificate sslHostConfigCertificateRsa = new
SSLHostConfigCertificate(sslHostConfig, Type.RSA);
@@ -265,6 +264,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest
{
private void configureHostEC() {
+ SSLHostConfig sslHostConfig = getSSLHostConfig();
switch (storeType) {
case KEYSTORE: {
SSLHostConfigCertificate sslHostConfigCertificateEc = new
SSLHostConfigCertificate(sslHostConfig, Type.EC);
@@ -324,6 +324,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest
{
connector.setSecure(true);
Assert.assertTrue(connector.setProperty("SSLEnabled", "true"));
TesterSupport.configureSSLImplementation(tomcat,
sslImplementationName);
+ SSLHostConfig sslHostConfig = new SSLHostConfig();
sslHostConfig.setProtocols("TLSv1.2");
connector.addSslHostConfig(sslHostConfig);
@@ -337,6 +338,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: [email protected]
For additional commands, e-mail: [email protected]