Only do handshake when authentication is necessary.