diff --git a/libs/java/server_common/src/main/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLogger.java b/libs/java/server_common/src/main/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLogger.java index 0f531a44013..d28e5c9f71d 100644 --- a/libs/java/server_common/src/main/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLogger.java +++ b/libs/java/server_common/src/main/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLogger.java @@ -118,6 +118,10 @@ public void onClosed(Connection connection) { metric.increment(METRIC_NAME, info.toMetric()); } connectionInfo.remove(endpoint); + if (connection instanceof SslConnection) { + SSLEngine sslEngine = ((SslConnection) connection).getSSLEngine(); + sslToConnectionInfo.remove(sslEngine); + } } }); } @@ -140,9 +144,13 @@ public void handshakeSucceeded(Event event) { public void handshakeFailed(Event event, Throwable failure) { SSLEngine sslEngine = event.getSSLEngine(); handleListenerInvocation("SslHandshakeListener", "handshakeFailed", "sslEngine=%h,failure=%s", Stream.of(sslEngine, failure).collect(Collectors.toList()), () -> { - LOGGER.error(failure.getMessage()); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug(failure.getMessage()); + } ConnectionInfo info = sslToConnectionInfo.remove(sslEngine); - info.setSslHandshakeFailure(failure); + if (info != null) { + info.setSslHandshakeFailure(failure); + } }); } //