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

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new ebb3b7d0b1 Fix possible NPE
ebb3b7d0b1 is described below

commit ebb3b7d0b10653316923a2f3a0f8e0ca82cfade0
Author: remm <r...@apache.org>
AuthorDate: Thu Sep 21 11:54:07 2023 +0200

    Fix possible NPE
---
 java/org/apache/catalina/valves/rewrite/ResolverImpl.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/rewrite/ResolverImpl.java 
b/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
index b6fa2d01cc..c7d9295bfe 100644
--- a/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
+++ b/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
@@ -185,10 +185,12 @@ public class ResolverImpl extends Resolver {
                 }
             } else if (key.equals("SSL_CIPHER_ALGKEYSIZE")) {
                 String cipherSuite = sslSupport.getCipherSuite();
-                Set<Cipher> cipherList = 
OpenSSLCipherConfigurationParser.parse(cipherSuite);
-                if (cipherList.size() == 1) {
-                    Cipher cipher = cipherList.iterator().next();
-                    return String.valueOf(cipher.getAlg_bits());
+                if (cipherSuite != null) {
+                    Set<Cipher> cipherList = 
OpenSSLCipherConfigurationParser.parse(cipherSuite);
+                    if (cipherList.size() == 1) {
+                        Cipher cipher = cipherList.iterator().next();
+                        return String.valueOf(cipher.getAlg_bits());
+                    }
                 }
             } else if (key.equals("SSL_CIPHER_USEKEYSIZE")) {
                 Integer keySize = sslSupport.getKeySize();
@@ -272,6 +274,7 @@ public class ResolverImpl extends Resolver {
             try {
                 return PEMFile.toPEM(certificates[0]);
             } catch (CertificateEncodingException e) {
+                // Ignore
             }
         } else if (key.startsWith("CERT_CHAIN_")) {
             key = key.substring("CERT_CHAIN_".length());


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to