diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConnect.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConnect.java index 2946fcafc6..f3fab1a9bb 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConnect.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConnect.java @@ -39,6 +39,7 @@ import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.HttpVersion; +import io.netty.handler.ssl.SslClosedEngineException; import io.netty.resolver.AddressResolverGroup; import io.netty.util.AsciiString; import io.netty.util.AttributeKey; @@ -382,6 +383,16 @@ else if (handler.shouldRetry && AbortedException.isConnectionReset(error)) { } } } + else if (error instanceof SslClosedEngineException) { + if (log.isWarnEnabled()) { + log.warn(format(connection.channel(), "The connection observed an error"), error); + } + HttpClientOperations ops = connection.as(HttpClientOperations.class); + if (ops != null) { + // javax.net.ssl.SSLEngine has been closed, do not return the connection to the pool + ops.markPersistent(false); + } + } else if (log.isWarnEnabled()) { log.warn(format(connection.channel(), "The connection observed an error"), error); }