This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new ad93e97940 [FIX] Silent verbose SSL logs in SMTP (#2578)
ad93e97940 is described below
commit ad93e97940d3f6668119f6b970295b831d341fa1
Author: Benoit TELLIER <[email protected]>
AuthorDate: Wed Dec 25 21:00:08 2024 +0100
[FIX] Silent verbose SSL logs in SMTP (#2578)
---
.../apache/james/protocols/netty/BasicChannelInboundHandler.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
index e6ece0a608..12c8827238 100644
---
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
+++
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
@@ -33,6 +33,7 @@ import java.util.List;
import java.util.Optional;
import java.util.concurrent.ConcurrentLinkedDeque;
+import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import org.apache.james.protocols.api.CommandDetectionSession;
@@ -286,6 +287,8 @@ public class BasicChannelInboundHandler extends
ChannelInboundHandlerAdapter imp
LOGGER.info("SSH handshake rejected {}",
cause.getMessage());
} else if (isNotSslRecordException(cause)) {
LOGGER.info("Not an SSL record {}", cause.getMessage());
+ } else if (isSslException(cause)) {
+ LOGGER.info("Encountered SSL exception: {}",
cause.getMessage());
} else if (!(cause instanceof ClosedChannelException)) {
LOGGER.error("Unable to process request", cause);
}
@@ -304,6 +307,11 @@ public class BasicChannelInboundHandler extends
ChannelInboundHandlerAdapter imp
cause.getCause() instanceof NotSslRecordException;
}
+ private boolean isSslException(Throwable cause) {
+ return cause instanceof DecoderException &&
+ cause.getCause() instanceof SSLException;
+ }
+
@Override
public void pushLineHandler(ChannelInboundHandlerAdapter
lineHandlerUpstreamHandler) {
behaviourOverrides.addFirst(lineHandlerUpstreamHandler);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]