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
commit d92f52a02cacc285ebec8c83bf91670f5a704345 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Feb 16 14:45:57 2023 +0000 Create a Java KeyManager for APR TLS endpoints if possible This exposes the certs to the Manager app and certificate debug logging --- java/org/apache/tomcat/util/net/AprEndpoint.java | 6 ++++++ java/org/apache/tomcat/util/net/LocalStrings.properties | 1 + 2 files changed, 7 insertions(+) diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 11ac0d901c..5a82cfcf42 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -468,6 +468,12 @@ public class AprEndpoint extends AbstractEndpoint<Long,Long> implements SNICallB } catch (Exception e) { throw new IllegalArgumentException(e.getMessage(), e); } + try { + KeyManager[] kms = sslUtil.getKeyManagers(); + certificate.setCertificateKeyManager(OpenSSLUtil.chooseKeyManager(kms)); + } catch (Exception e) { + log.debug(sm.getString("endpoint.apr.keyManagerError"), e); + } } else { SSLUtil sslUtil = new OpenSSLUtil(certificate); KeyManager[] kms = sslUtil.getKeyManagers(); diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties index b09b0b0094..0dce57d31a 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings.properties @@ -52,6 +52,7 @@ endpoint.apr.errApplyConf=Could not apply OpenSSLConf to SSL context endpoint.apr.errCheckConf=Error during OpenSSLConf check endpoint.apr.errMakeConf=Could not create OpenSSLConf context endpoint.apr.failSslContextMake=Unable to create SSLContext. Check that SSLEngine is enabled in the AprLifecycleListener, the AprLifecycleListener has initialised correctly and that a valid SSLProtocol has been specified +endpoint.apr.keyManagerError=Unable to construct Java KeyManager for provided TLS key endpoint.apr.invalidSslProtocol=An invalid value [{0}] was provided for the SSLProtocol attribute endpoint.apr.maxConnections.running=The APR endpoint does not support the setting of maxConnections while it is running. The existing value of [{0}] will continue to be used. endpoint.apr.maxConnections.unlimited=The APR endpoint does not support unlimited connections. The existing value of [{0}] will continue to be used. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org