handle handshake failures in SSL