Closing the connection on invalid handshake