@Override
        protected SslTransportLayer buildTransportLayer(SslFactory sslFactory, String id, SelectionKey key,
                                                        ChannelMetadataRegistry metadataRegistry) {
            SocketChannel socketChannel = (SocketChannel) key.channel();
            SSLEngine sslEngine = sslFactory.createSslEngine(socketChannel.socket());
            return new TestSslTransportLayer(id, key, sslEngine, metadataRegistry);
        }
Connects and waits for handshake to complete. This is required since SslTransportLayer
implementation requires the channel to be ready before send is invoked (unlike plaintext
where send can be invoked straight after connect)
clients/src/test/java/org/apache/kafka/common/network/SslSelectorTest.java