mirror of
https://github.com/corda/corda.git
synced 2025-06-11 20:01:46 +00:00
ENT-2036 Handle ClosedChannelException during SSL handshake (#3314)
This commit is contained in:
@ -21,6 +21,7 @@ import org.apache.qpid.proton.engine.impl.ProtocolTracer
|
|||||||
import org.apache.qpid.proton.framing.TransportFrame
|
import org.apache.qpid.proton.framing.TransportFrame
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import java.net.InetSocketAddress
|
import java.net.InetSocketAddress
|
||||||
|
import java.nio.channels.ClosedChannelException
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,7 +103,12 @@ internal class AMQPChannelHandler(private val serverMode: Boolean,
|
|||||||
createAMQPEngine(ctx)
|
createAMQPEngine(ctx)
|
||||||
onOpen(Pair(ctx.channel() as SocketChannel, ConnectionChange(remoteAddress, remoteCert, true, false)))
|
onOpen(Pair(ctx.channel() as SocketChannel, ConnectionChange(remoteAddress, remoteCert, true, false)))
|
||||||
} else {
|
} else {
|
||||||
badCert = true
|
// This happens when the peer node is closed during SSL establishment.
|
||||||
|
if (evt.cause() is ClosedChannelException) {
|
||||||
|
log.warn("SSL Handshake closed early.")
|
||||||
|
} else {
|
||||||
|
badCert = true
|
||||||
|
}
|
||||||
log.error("Handshake failure ${evt.cause().message}")
|
log.error("Handshake failure ${evt.cause().message}")
|
||||||
if (log.isTraceEnabled) {
|
if (log.isTraceEnabled) {
|
||||||
log.trace("Handshake failure", evt.cause())
|
log.trace("Handshake failure", evt.cause())
|
||||||
|
Reference in New Issue
Block a user