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 1fb42bae8b Use constant
1fb42bae8b is described below

commit 1fb42bae8bb6e1eaf3ca494bcb98fef134ac59b0
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Sep 9 15:50:58 2024 +0100

    Use constant
---
 test/org/apache/tomcat/util/net/TestCustomSsl.java           | 2 ++
 test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java | 8 ++++----
 test/org/apache/tomcat/util/net/TesterSupport.java           | 3 ++-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/TestCustomSsl.java 
b/test/org/apache/tomcat/util/net/TestCustomSsl.java
index fc458cf14e..f4311a9e03 100644
--- a/test/org/apache/tomcat/util/net/TestCustomSsl.java
+++ b/test/org/apache/tomcat/util/net/TestCustomSsl.java
@@ -62,6 +62,8 @@ public class TestCustomSsl extends TomcatBaseTest {
         File keystoreFile = new File(TesterSupport.LOCALHOST_RSA_JKS);
         certificate.setCertificateKeystoreFile(keystoreFile.getAbsolutePath());
 
+        certificate.setCertificateKeyPassword(TesterSupport.JKS_PASS);
+
         connector.setSecure(true);
         Assert.assertTrue(connector.setProperty("SSLEnabled", "true"));
 
diff --git a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java 
b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
index 3c185ea3fe..9d5c8ecbf8 100644
--- a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
+++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
@@ -244,7 +244,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
         case KEYSTORE: {
             SSLHostConfigCertificate sslHostConfigCertificateRsa = new 
SSLHostConfigCertificate(sslHostConfig, Type.RSA);
             
sslHostConfigCertificateRsa.setCertificateKeystoreFile(getPath(TesterSupport.LOCALHOST_RSA_JKS));
-            
sslHostConfigCertificateRsa.setCertificateKeystorePassword("changeit");
+            
sslHostConfigCertificateRsa.setCertificateKeystorePassword(TesterSupport.JKS_PASS);
             sslHostConfig.addCertificate(sslHostConfigCertificateRsa);
             break;
         }
@@ -252,7 +252,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
             SSLHostConfigCertificate sslHostConfigCertificateRsa = new 
SSLHostConfigCertificate(sslHostConfig, Type.RSA);
             
sslHostConfigCertificateRsa.setCertificateFile(getPath(TesterSupport.LOCALHOST_RSA_CERT_PEM));
             
sslHostConfigCertificateRsa.setCertificateKeyFile(getPath(TesterSupport.LOCALHOST_RSA_KEY_PEM));
-            sslHostConfigCertificateRsa.setCertificateKeyPassword("changeit");
+            
sslHostConfigCertificateRsa.setCertificateKeystorePassword(TesterSupport.JKS_PASS);
             sslHostConfig.addCertificate(sslHostConfigCertificateRsa);
             break;
         }
@@ -266,7 +266,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
         case KEYSTORE: {
             SSLHostConfigCertificate sslHostConfigCertificateEc = new 
SSLHostConfigCertificate(sslHostConfig, Type.EC);
             
sslHostConfigCertificateEc.setCertificateKeystoreFile(getPath(TesterSupport.LOCALHOST_EC_JKS));
-            
sslHostConfigCertificateEc.setCertificateKeystorePassword("changeit");
+            
sslHostConfigCertificateEc.setCertificateKeystorePassword(TesterSupport.JKS_PASS);
             sslHostConfig.addCertificate(sslHostConfigCertificateEc);
             break;
         }
@@ -274,7 +274,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest 
{
             SSLHostConfigCertificate sslHostConfigCertificateEc = new 
SSLHostConfigCertificate(sslHostConfig, Type.EC);
             
sslHostConfigCertificateEc.setCertificateFile(getPath(TesterSupport.LOCALHOST_EC_CERT_PEM));
             
sslHostConfigCertificateEc.setCertificateKeyFile(getPath(TesterSupport.LOCALHOST_EC_KEY_PEM));
-            sslHostConfigCertificateEc.setCertificateKeyPassword("changeit");
+            
sslHostConfigCertificateEc.setCertificateKeyPassword(TesterSupport.JKS_PASS);
             sslHostConfig.addCertificate(sslHostConfigCertificateEc);
             break;
         }
diff --git a/test/org/apache/tomcat/util/net/TesterSupport.java 
b/test/org/apache/tomcat/util/net/TesterSupport.java
index ca3a4cee6d..308f28acc2 100644
--- a/test/org/apache/tomcat/util/net/TesterSupport.java
+++ b/test/org/apache/tomcat/util/net/TesterSupport.java
@@ -109,6 +109,7 @@ public final class TesterSupport {
     }
 
     public static void initSsl(Tomcat tomcat) {
+        // TLS material for tests uses default password
         initSsl(tomcat, LOCALHOST_RSA_JKS, null, null, null, null);
     }
 
@@ -141,7 +142,7 @@ public final class TesterSupport {
         if (keystorePass != null) {
             certificate.setCertificateKeystorePassword(keystorePass);
         } else {
-            certificate.setCertificateKeystorePassword("changeit");
+            certificate.setCertificateKeystorePassword(JKS_PASS);
         }
         if (keyPassFile != null) {
             certificate.setCertificateKeyPasswordFile(new 
File(keyPassFile).getAbsolutePath());


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

Reply via email to