-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress noisy SSL exceptions #61359
Suppress noisy SSL exceptions #61359
Conversation
If a TLS-protected connection closes unexpectedly then today we often emit a `WARN` log, typically one of the following: io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Insufficient buffer remaining for AEAD cipher fragment (2). Needs to be more than tag size (16) io.netty.handler.codec.DecoderException: javax.net.ssl.SSLException: Received close_notify during handshake We typically only report unexpectedly-closed connections at `DEBUG` level, but these two messages don't follow that rule and generate a lot of noise as a result. This commit adjusts the logging to report these two exceptions at `DEBUG` level only.
Pinging @elastic/es-security (:Security/Network) |
I could do with guidance on testing this change, I couldn't find a pre-existing test suite for this area, nor do I know how to trigger these exceptions synthetically. |
@@ -22,6 +24,11 @@ public static boolean isNotSslRecordException(Throwable e) { | |||
} | |||
|
|||
public static boolean isCloseDuringHandshakeException(Throwable e) { | |||
return isCloseDuringHandshakeSSLException(e) | |||
|| isCloseDuringHandshakeSSLException(e.getCause()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were already checking for Received close_notify during handshake
, just not within a DecoderException
. Not sure whether this was a mistake or whether we do sometimes see this exception unwrapped too.
Also not sure what the implications for the nio
transport since the DecoderException
wrapper is Netty-specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks Tim! |
If a TLS-protected connection closes unexpectedly then today we often emit a `WARN` log, typically one of the following: io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Insufficient buffer remaining for AEAD cipher fragment (2). Needs to be more than tag size (16) io.netty.handler.codec.DecoderException: javax.net.ssl.SSLException: Received close_notify during handshake We typically only report unexpectedly-closed connections at `DEBUG` level, but these two messages don't follow that rule and generate a lot of noise as a result. This commit adjusts the logging to report these two exceptions at `DEBUG` level only.
If a TLS-protected connection closes unexpectedly then today we often
emit a
WARN
log, typically one of the following:We typically only report unexpectedly-closed connections at
DEBUG
level, but these two messages don't follow that rule and generate a lot
of noise as a result. This commit adjusts the logging to report these
two exceptions at
DEBUG
level only.