You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/01/06 09:55:52 UTC
(tomcat) branch main updated (5de4207d5e -> 80d938f3d4)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
from 5de4207d5e Better fix for mix of JSSE and OpenSSL config styles
new da9b88e56a Reduce warnings when running TLS tests
new bace84a81a Fix typo
new 0b1f2d2d11 Better wording
new 4adf369625 Improve warning for using OpenSSLConf with JSSE implementations
new 80d938f3d4 For OpenSSL+FFM, only configure CA certs if configuration is present
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/tomcat/util/net/LocalStrings.properties | 1 +
java/org/apache/tomcat/util/net/SSLHostConfig.java | 43 +++++++++++++++++-----
java/org/apache/tomcat/util/net/jsse/JSSEUtil.java | 5 +++
.../tomcat/util/net/jsse/LocalStrings.properties | 1 +
.../util/net/openssl/panama/OpenSSLContext.java | 8 ++--
webapps/docs/changelog.xml | 17 ++++++++-
webapps/docs/config/http.xml | 22 ++++++++---
7 files changed, 75 insertions(+), 22 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 02/05: Fix typo
Posted by ma...@apache.org.
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
commit bace84a81a1d42ec0886597aed964377afa29034
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jan 6 08:40:37 2026 +0000
Fix typo
---
webapps/docs/changelog.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 963e365291..e5de9ebbbd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -224,7 +224,7 @@
</update>
<!-- Entries for backport and removal before 12.0.0-M1 below this line -->
<fix>
- Improve warnings when setting ciphers lists in the FFM code, mirrorring
+ Improve warnings when setting ciphers lists in the FFM code, mirroring
the tomcat-native changes. (remm)
</fix>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 03/05: Better wording
Posted by ma...@apache.org.
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
commit 0b1f2d2d114d2938b94ce19a587f78dacf429fa9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jan 6 08:45:49 2026 +0000
Better wording
---
webapps/docs/config/http.xml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index d1b17d48ba..c7e9c63b8a 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -1153,17 +1153,17 @@
attributes to the values <code>https</code> and <code>true</code>
respectively, to pass correct information to the servlets.</p>
- <p>The NIO connector uses either the JSSE Java SSL implementation or
- an OpenSSL implementation. As far as possible, common configuration attributes
- are used for both JSSE and OpenSSL. You must use a consistent configuration
- style (JSSE specific attributes or OpenSSL specfic attributes) for each of the
- following groups of configuration attributes but you may use a different
- configuration style for each group:</p>
+ <p>The NIO connector may be configured to use either a JSSE Java SSL
+ implementation or an OpenSSL implementation. As far as possible, common
+ configuration attributes are used for both JSSE and OpenSSL. You must use a
+ consistent configuration style (JSSE specific attributes or OpenSSL specfic
+ attributes) for each of the following groups of configuration attributes but
+ you may use a different configuration style for each group:</p>
<ul>
<li>trust attributes</li>
<li>all other attributes</li>
</ul>
- <p>The implementation used (JSSE or the OpenSSL) is independent of the
+ <p>The implementation used (JSSE or OpenSSL) is independent of the
configuration style used.</p>
<p>Each secure connector must define at least one
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 01/05: Reduce warnings when running TLS tests
Posted by ma...@apache.org.
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
commit da9b88e56a9da87ac6d9faf81990332dd6519366
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jan 6 08:37:08 2026 +0000
Reduce warnings when running TLS tests
---
.../apache/tomcat/util/net/LocalStrings.properties | 1 +
java/org/apache/tomcat/util/net/SSLHostConfig.java | 42 +++++++++++++++++-----
webapps/docs/changelog.xml | 6 ++++
webapps/docs/config/http.xml | 14 +++++---
4 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 1886680130..a07a8866f0 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -149,6 +149,7 @@ sslHostConfig.certificateVerificationInvalid=The certificate verification value
sslHostConfig.fileNotFound=Configured file [{0}] does not exist
sslHostConfig.invalid_truststore_password=The provided trust store password could not be used to unlock and/or validate the trust store. Retrying to access the trust store with a null password which will skip validation.
sslHostConfig.mismatch=The property [{0}] was set on the SSLHostConfig named [{1}] and is for the [{2}] configuration syntax but the SSLHostConfig is being used with the [{3}] configuration syntax
+sslHostConfig.mismatch.trust=The trust configuration property [{0}] was set on the SSLHostConfig named [{1}] and is for the [{2}] configuration syntax but the SSLHostConfig is being used with the [{3}] trust configuration syntax
sslHostConfig.opensslconf.alreadyset=Attempt to set another OpenSSLConf ignored
sslHostConfig.opensslconf.null=Attempt to set null OpenSSLConf ignored
sslHostConfig.prefix_missing=The protocol [{0}] was added to the list of protocols on the SSLHostConfig named [{1}]. Check if a +/- prefix is missing.
diff --git a/java/org/apache/tomcat/util/net/SSLHostConfig.java b/java/org/apache/tomcat/util/net/SSLHostConfig.java
index 1ab4233439..600aa32f0a 100644
--- a/java/org/apache/tomcat/util/net/SSLHostConfig.java
+++ b/java/org/apache/tomcat/util/net/SSLHostConfig.java
@@ -80,6 +80,7 @@ public class SSLHostConfig implements Serializable {
}
private Type configType = null;
+ private Type trustConfigType = null;
private String hostName = DEFAULT_SSL_HOST_NAME;
@@ -188,7 +189,7 @@ public class SSLHostConfig implements Serializable {
* @param name the property name
* @param configType the configuration type
*
- * @return true if the property belongs to the current configuration, and false otherwise
+ * @return true if the property belongs to the current configuration type, and false otherwise
*/
boolean setProperty(String name, Type configType) {
if (this.configType == null) {
@@ -203,6 +204,28 @@ public class SSLHostConfig implements Serializable {
}
+ /**
+ * Set property which belongs to the specified trust configuration type.
+ *
+ * @param name the property name
+ * @param trustConfigType the trust configuration type
+ *
+ * @return true if the property belongs to the current trust configuration type, and false otherwise
+ */
+ boolean setTrustProperty(String name, Type trustConfigType) {
+ if (this.trustConfigType == null) {
+ this.trustConfigType = trustConfigType;
+ } else {
+ if (trustConfigType != this.trustConfigType) {
+ log.warn(sm.getString("sslHostConfig.mismatch.trust", name, getHostName(), trustConfigType,
+ this.trustConfigType));
+ return false;
+ }
+ }
+ return true;
+ }
+
+
// ----------------------------------------------------- Internal properties
/**
@@ -606,7 +629,7 @@ public class SSLHostConfig implements Serializable {
public void setTrustManagerClassName(String trustManagerClassName) {
- setProperty("trustManagerClassName", Type.JSSE);
+ setTrustProperty("trustManagerClassName", Type.JSSE);
this.trustManagerClassName = trustManagerClassName;
}
@@ -617,7 +640,7 @@ public class SSLHostConfig implements Serializable {
public void setTruststoreAlgorithm(String truststoreAlgorithm) {
- setProperty("truststoreAlgorithm", Type.JSSE);
+ setTrustProperty("truststoreAlgorithm", Type.JSSE);
this.truststoreAlgorithm = truststoreAlgorithm;
}
@@ -628,7 +651,7 @@ public class SSLHostConfig implements Serializable {
public void setTruststoreFile(String truststoreFile) {
- setProperty("truststoreFile", Type.JSSE);
+ setTrustProperty("truststoreFile", Type.JSSE);
this.truststoreFile = truststoreFile;
}
@@ -639,7 +662,7 @@ public class SSLHostConfig implements Serializable {
public void setTruststorePassword(String truststorePassword) {
- setProperty("truststorePassword", Type.JSSE);
+ setTrustProperty("truststorePassword", Type.JSSE);
this.truststorePassword = truststorePassword;
}
@@ -650,7 +673,7 @@ public class SSLHostConfig implements Serializable {
public void setTruststoreProvider(String truststoreProvider) {
- setProperty("truststoreProvider", Type.JSSE);
+ setTrustProperty("truststoreProvider", Type.JSSE);
this.truststoreProvider = truststoreProvider;
}
@@ -669,7 +692,7 @@ public class SSLHostConfig implements Serializable {
public void setTruststoreType(String truststoreType) {
- setProperty("truststoreType", Type.JSSE);
+ setTrustProperty("truststoreType", Type.JSSE);
this.truststoreType = truststoreType;
}
@@ -693,6 +716,7 @@ public class SSLHostConfig implements Serializable {
public void setTrustStore(KeyStore truststore) {
+ setTrustProperty("trustStore", Type.JSSE);
this.truststore = truststore;
}
@@ -737,7 +761,7 @@ public class SSLHostConfig implements Serializable {
public void setCaCertificateFile(String caCertificateFile) {
- if (setProperty("caCertificateFile", Type.OPENSSL)) {
+ if (setTrustProperty("caCertificateFile", Type.OPENSSL)) {
// Reset default JSSE trust store if not a JSSE configuration
if (truststoreFile != null) {
truststoreFile = null;
@@ -753,7 +777,7 @@ public class SSLHostConfig implements Serializable {
public void setCaCertificatePath(String caCertificatePath) {
- if (setProperty("caCertificatePath", Type.OPENSSL)) {
+ if (setTrustProperty("caCertificatePath", Type.OPENSSL)) {
// Reset default JSSE trust store if not a JSSE configuration
if (truststoreFile != null) {
truststoreFile = null;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6b12acd8d7..963e365291 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -231,6 +231,12 @@
<bug>69910</bug>: Dereference TLS objects right after closing a socket
to improve memory efficiency. (remm)
</fix>
+ <fix>
+ Relax the JSSE vs OpenSSL configuration style checks on
+ <code>SSLHostConfig</code> to reflect the existing implementation that
+ allows one configuration style to be used for the trust attributes and a
+ different style for all the other attributes. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 627122a3cc..d1b17d48ba 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -1155,10 +1155,16 @@
<p>The NIO connector uses either the JSSE Java SSL implementation or
an OpenSSL implementation. As far as possible, common configuration attributes
- are used for both JSSE and OpenSSL. You cannot mix JSSE specific configuration
- attributes and OpenSSL specific configuration attributes on the same
- connector. However, you may use either the JSSE or the OpenSSL configuration
- style with either the JSSE and OpenSSL implementations.</p>
+ are used for both JSSE and OpenSSL. You must use a consistent configuration
+ style (JSSE specific attributes or OpenSSL specfic attributes) for each of the
+ following groups of configuration attributes but you may use a different
+ configuration style for each group:</p>
+ <ul>
+ <li>trust attributes</li>
+ <li>all other attributes</li>
+ </ul>
+ <p>The implementation used (JSSE or the OpenSSL) is independent of the
+ configuration style used.</p>
<p>Each secure connector must define at least one
<strong>SSLHostConfig</strong>. The names of the
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 05/05: For OpenSSL+FFM, only configure CA certs if configuration is present
Posted by ma...@apache.org.
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
commit 80d938f3d43d5b1b2a157d3fbb76b81b238e89b9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jan 6 09:12:36 2026 +0000
For OpenSSL+FFM, only configure CA certs if configuration is present
---
.../org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java | 8 +++-----
webapps/docs/changelog.xml | 5 +++++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
index 56bf0989d5..25e2d5acc7 100644
--- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
+++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
@@ -557,7 +557,7 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext {
SSL_CTX_set_verify(state.sslCtx, value,
SSL_CTX_set_verify$callback.allocate(new OpenSSLEngine.VerifyCallback(), contextArena));
- // Trust and certificate verification
+ // Trust and certificate verification (optional - may not be configured)
if (tms != null) {
// Client certificate verification based on custom trust managers
x509TrustManager = chooseTrustManager(tms);
@@ -580,7 +580,7 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext {
log.debug(sm.getString("openssl.addedClientCaCert", caCert.toString()));
}
}
- } else {
+ } else if (sslHostConfig.getCaCertificateFile() != null || sslHostConfig.getCaCertificatePath() != null) {
// Client certificate verification based on trusted CA files and dirs
MemorySegment caCertificateFileNative = sslHostConfig.getCaCertificateFile() != null ?
localArena
@@ -590,9 +590,7 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext {
localArena
.allocateFrom(SSLHostConfig.adjustRelativePath(sslHostConfig.getCaCertificatePath())) :
MemorySegment.NULL;
- if ((sslHostConfig.getCaCertificateFile() != null || sslHostConfig.getCaCertificatePath() != null) &&
- SSL_CTX_load_verify_locations(state.sslCtx, caCertificateFileNative,
- caCertificatePathNative) <= 0) {
+ if (SSL_CTX_load_verify_locations(state.sslCtx, caCertificateFileNative, caCertificatePathNative) <= 0) {
logLastError("openssl.errorConfiguringLocations");
} else {
var caCerts = SSL_CTX_get_client_CA_list(state.sslCtx);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 685d2c5ba1..3c04124ddb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -241,6 +241,11 @@
Better warning message when <code>OpenSSLConf</code> configuration
elements are used with a JSSE TLS implementation. (markt)
</fix>
+ <fix>
+ When using OpenSSL via FFM, don't log a warning about missing CA
+ certificates unless CA certificates were configured and the
+ configuration failed. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 04/05: Improve warning for using OpenSSLConf with JSSE implementations
Posted by ma...@apache.org.
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
commit 4adf369625cc1b58f5120e53488d6587783d8bad
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jan 6 08:57:06 2026 +0000
Improve warning for using OpenSSLConf with JSSE implementations
---
java/org/apache/tomcat/util/net/SSLHostConfig.java | 1 -
java/org/apache/tomcat/util/net/jsse/JSSEUtil.java | 5 +++++
java/org/apache/tomcat/util/net/jsse/LocalStrings.properties | 1 +
webapps/docs/changelog.xml | 4 ++++
webapps/docs/config/http.xml | 4 ++++
5 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/tomcat/util/net/SSLHostConfig.java b/java/org/apache/tomcat/util/net/SSLHostConfig.java
index 600aa32f0a..e78a155230 100644
--- a/java/org/apache/tomcat/util/net/SSLHostConfig.java
+++ b/java/org/apache/tomcat/util/net/SSLHostConfig.java
@@ -310,7 +310,6 @@ public class SSLHostConfig implements Serializable {
} else if (openSslConf != null) {
throw new IllegalArgumentException(sm.getString("sslHostConfig.opensslconf.alreadySet"));
}
- setProperty("<OpenSSLConf>", Type.OPENSSL);
openSslConf = conf;
}
diff --git a/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java b/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java
index 93e47cd02a..17ae7991f4 100644
--- a/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java
+++ b/java/org/apache/tomcat/util/net/jsse/JSSEUtil.java
@@ -142,6 +142,11 @@ public class JSSEUtil extends SSLUtilBase {
} else {
implementedCiphers = new HashSet<>(Arrays.asList(implementedCipherSuiteArray));
}
+
+ if (sslHostConfig.getOpenSslConf() != null) {
+ log.warn(sm.getString("jsseUtil.opensslconf.present"));
+ }
+
initialized = true;
}
}
diff --git a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
index d4cdaa1105..ef16a01b9e 100644
--- a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
@@ -18,6 +18,7 @@ jsseSupport.clientCertError=Error trying to obtain a certificate from the client
jsseUtil.excludeProtocol=The SSL protocol [{0}] which is supported in this JRE was excluded from the protocols available to Tomcat
jsseUtil.noDefaultProtocols=Unable to determine a default for sslEnabledProtocols. Set an explicit value to ensure the connector can start.
+jsseUtil.opensslconf.present=A connector is configured to use a JSSE TLS implementation with OpenSSL specific OpenSSLConf configuration elements. The OpenSSLConf configuration elements will be ignored.
pemFile.noMultiPrimes=The PKCS#1 certificate is in multi-prime format and Java does not provide an API for constructing an RSA private key object from that format
pemFile.noPassword=A password is required to decrypt the private key
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e5de9ebbbd..685d2c5ba1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -237,6 +237,10 @@
allows one configuration style to be used for the trust attributes and a
different style for all the other attributes. (markt)
</fix>
+ <fix>
+ Better warning message when <code>OpenSSLConf</code> configuration
+ elements are used with a JSSE TLS implementation. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index c7e9c63b8a..eba04b451c 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -1166,6 +1166,10 @@
<p>The implementation used (JSSE or OpenSSL) is independent of the
configuration style used.</p>
+ <p>Any <code>OpenSSLConf</code> settings are only used with an OpenSSL
+ implementation and may override attributes set via <code>SSLHostConfig</code>
+ or <code>Certificate</code> elements.</p>
+
<p>Each secure connector must define at least one
<strong>SSLHostConfig</strong>. The names of the
<strong>SSLHostConfig</strong> elements must be unique and one of them must
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org