def _do_ssl_handshake(self):
        try:
            sock_debug('Doing SSL handshake')
            self._sock.do_handshake()
        except ssl.SSLError as e:
            sock_debug('Floobits: ssl.SSLError. This is expected sometimes.')
            if e.args[0] in [ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE]:
                return False
            self.stop()
            editor.error_message('Floobits SSL handshake error: %s' % str(e))
            sock_debug('SSLError args: %s' % ''.join([str(a) for a in e.args]))
        except Exception as e:
            msg.error('Error in SSL handshake: ', str_e(e))
        else:
            sock_debug('Successful handshake')
            self._needs_handshake = False
            editor.status_message('%s:%s: SSL handshake completed' % (self.host, self.port))
            return True

        self.reconnect()
        return False
dataset/ETHPy150Open Floobits/floobits-sublime/floo/common/protocols/floo_proto.py/FlooProtocol._do_ssl_handshake/original