@Override
    public HandshakeResult handshake() throws IOException {
        HandshakeState newHandshakeState = processHandshakeState(this.handshakeState);
        log.fine(() -> String.format("Handshake state '%s -> %s'", this.handshakeState, newHandshakeState));
        this.handshakeState = newHandshakeState;
        return toHandshakeResult(newHandshakeState);
    }
A {@link CryptoSocket} using TLS ({@link SSLEngine})

@author bjorncs
jrt/src/com/yahoo/jrt/TlsCryptoSocket.java