This is an automated email from the ASF dual-hosted git repository.

rmaucher 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 9f98160d5d Skip certificate logging if SSLContext is null
9f98160d5d is described below

commit 9f98160d5d4c7ea8caec55380132da23e1c98692
Author: remm <[email protected]>
AuthorDate: Fri Aug 28 17:53:48 2026 +0200

    Skip certificate logging if SSLContext is null
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 021a946ee9..aff72b5282 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -639,12 +639,13 @@ public abstract class AbstractEndpoint<S, U> {
         getLogCertificate().info(sm.getString("endpoint.tls.info", getName(), 
sslHostConfig.getHostName(),
                 certificate.getType(), certificateInfo, trustStoreSource));
 
-        if (getLogCertificate().isDebugEnabled()) {
+        SSLContext sslContext = certificate.getSslContext();
+        if (getLogCertificate().isDebugEnabled() && sslContext != null) {
             String alias = certificate.getCertificateKeyAlias();
             if (alias == null) {
                 alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
             }
-            X509Certificate[] x509Certificates = 
certificate.getSslContext().getCertificateChain(alias);
+            X509Certificate[] x509Certificates = 
sslContext.getCertificateChain(alias);
             if (x509Certificates != null && x509Certificates.length > 0) {
                 
getLogCertificate().debug(generateCertificateDebug(x509Certificates[0]));
             } else {


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

Reply via email to