conn.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:deb-python-kafka 作者: openstack 项目源码 文件源码
def _try_handshake(self):
        assert self.config['security_protocol'] in ('SSL', 'SASL_SSL')
        try:
            self._sock.do_handshake()
            return True
        # old ssl in python2.6 will swallow all SSLErrors here...
        except (SSLWantReadError, SSLWantWriteError):
            pass
        except (SSLZeroReturnError, ConnectionError):
            log.warning('SSL connection closed by server during handshake.')
            self.close(Errors.ConnectionError('SSL connection closed by server during handshake'))
        # Other SSLErrors will be raised to user

        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号