ssl_support.py 文件源码

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

项目:zanph 作者: zanph 项目源码 文件源码
def get_win_certfile():
    global _wincerts
    if _wincerts is not None:
        return _wincerts.name

    try:
        from wincertstore import CertFile
    except ImportError:
        return None

    class MyCertFile(CertFile):
        def __init__(self, stores=(), certs=()):
            CertFile.__init__(self)
            for store in stores:
                self.addstore(store)
            self.addcerts(certs)
            atexit.register(self.close)

        def close(self):
            try:
                super(MyCertFile, self).close()
            except OSError:
                pass

    _wincerts = MyCertFile(stores=['CA', 'ROOT'])
    return _wincerts.name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号