Skip to content

Apache Lucene open-source search software

improved logging for debug errors such as these SOLR-9143

Noble Paul5a1859989250
diff --git a/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java b/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
index 36a7825efe0..fb3665c0f92 100644
--- a/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
+++ b/solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java
@@ -64,14 +64,7 @@ public class PKIAuthenticationPlugin extends AuthenticationPlugin implements Htt
private final Map<String, PublicKey> keyCache = new ConcurrentHashMap<>();
private final CryptoKeys.RSAKeyPair keyPair = new CryptoKeys.RSAKeyPair();
private final CoreContainer cores;
- private final int MAX_VALIDITY = getTTL();
-
- private int getTTL() {
- String ttl = System.getProperty("pkiauth.ttl");
- if (ttl != null) log.info("TTL is set to {}ms", ttl);
- return Integer.parseInt(System.getProperty("pkiauth.ttl", "5000"));
- }
-
+ private final int MAX_VALIDITY = Integer.parseInt(System.getProperty("pkiauth.ttl", "5000"));
private final String myNodeName;
private final HttpHeaderClientInterceptor interceptor = new HttpHeaderClientInterceptor();
private boolean interceptorRegistered = false;
@@ -129,7 +122,7 @@ public class PKIAuthenticationPlugin extends AuthenticationPlugin implements Htt
return;
}
if ((receivedTime - decipher.timestamp) > MAX_VALIDITY) {
- log.error("Invalid key request timestamp {} : received timestamp {}", decipher.timestamp, receivedTime);
+ log.error("Invalid key request timestamp: {} , received timestamp: {} , TTL: {}", decipher.timestamp, receivedTime, MAX_VALIDITY);
filterChain.doFilter(request, response);
return;
}