From 5a18599892509a22647135b0d6b55ca7b1fd36ff Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Tue, 24 May 2016 10:39:11 +0530 Subject: [PATCH] improved logging for debug errors such as these SOLR-9143 --- .../apache/solr/security/PKIAuthenticationPlugin.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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 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; }