c982d45493
Motivation: The TLS handshake must be able to finish on its own, without being driven by outside read calls. This is currently not the case when TCP FastOpen is enabled. Reads must be permitted and marked as pending, even when a channel is not active. This is important because, with TCP FastOpen, the handshake processing of a TLS connection will start before the connection has been established -- before the process of connecting has even been started. The SslHandler on the client side will add the Client Hello message to the ChannelOutboundBuffer, then issue a `ctx.read` call for the anticipated Server Hello response, and then flush the Client Hello message which, in the case of TCP FastOpen, will cause the TCP connection to be established. In this transaction, it is important that the `ctx.read` call is not ignored since, if auto-read is turned off, this could delay or even prevent the Server Hello message from being processed, causing the server-side handshake to time out. Modification: Attach a listener to the SslHandler.handshakeFuture in the EchoClient, that will call ctx.read. Result: The SocketSslEchoTest now tests that the SslHandler can finish handshakes on its own, without being driven by 3rd party ctx.read calls. The various channel implementations have been updated to comply with this behaviour. |
||
---|---|---|
.. | ||
src/main/java/io/netty/testsuite | ||
.gitignore | ||
pom.xml |