This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new c9faa843ca Fix possible NPE
c9faa843ca is described below
commit c9faa843ca6877505aea344b80ed195a0538f9d8
Author: remm <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]