SocketBase.py 文件源码

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

项目:newsreap 作者: caronc 项目源码 文件源码
def __ssl_version(self, try_next=False):
        """
        Returns an SSL Context Object while handling the many
        supported protocols
        """

        if try_next:
            # Increment version
            self.secure_protocol_idx += 1

        while self.secure_protocol_idx < len(SECURE_PROTOCOL_PRIORITY):
            # Now return it
            return SECURE_PROTOCOL_PRIORITY[self.secure_protocol_idx][0]

        # If we reach here, we had a problem; use SocketRetryLimit() instead
        # of SocketException() since we're at the end of the line now.
        raise SocketRetryLimit('There are no protocols left to try.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号