当前位置: 首页>>代码示例>>Python>>正文


Python wincertstore.CertFile方法代码示例

本文整理汇总了Python中wincertstore.CertFile方法的典型用法代码示例。如果您正苦于以下问题:Python wincertstore.CertFile方法的具体用法?Python wincertstore.CertFile怎么用?Python wincertstore.CertFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wincertstore的用法示例。


在下文中一共展示了wincertstore.CertFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_win_certfile

# 需要导入模块: import wincertstore [as 别名]
# 或者: from wincertstore import CertFile [as 别名]
def get_win_certfile():
    try:
        import wincertstore
    except ImportError:
        return None

    class CertFile(wincertstore.CertFile):
        def __init__(self):
            super(CertFile, self).__init__()
            atexit.register(self.close)

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

    _wincerts = CertFile()
    _wincerts.addstore('CA')
    _wincerts.addstore('ROOT')
    return _wincerts.name 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:23,代码来源:ssl_support.py

示例2: _load_wincerts

# 需要导入模块: import wincertstore [as 别名]
# 或者: from wincertstore import CertFile [as 别名]
def _load_wincerts():
        """Set _WINCERTS to an instance of wincertstore.Certfile."""
        global _WINCERTS

        certfile = CertFile()
        certfile.addstore("CA")
        certfile.addstore("ROOT")
        atexit.register(certfile.close)

        _WINCERTS = certfile

    # XXX: Possible future work.
    # - OCSP? Not supported by python at all.
    #   http://bugs.python.org/issue17123
    # - Adding an ssl_context keyword argument to MongoClient? This might
    #   be useful for sites that have unusual requirements rather than
    #   trying to expose every SSLContext option through a keyword/uri
    #   parameter. 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:20,代码来源:ssl_support.py

示例3: _load_wincerts

# 需要导入模块: import wincertstore [as 别名]
# 或者: from wincertstore import CertFile [as 别名]
def _load_wincerts():
        """Set _WINCERTS to an instance of wincertstore.Certfile."""
        global _WINCERTS

        certfile = CertFile()
        certfile.addstore("CA")
        certfile.addstore("ROOT")
        atexit.register(certfile.close)

        _WINCERTS = certfile

    # XXX: Possible future work.
    # - Support CRL files? Only supported by CPython >= 2.7.9 and >= 3.4
    #   http://bugs.python.org/issue8813
    # - OCSP? Not supported by python at all.
    #   http://bugs.python.org/issue17123
    # - Setting OP_NO_COMPRESSION? The server doesn't yet.
    # - Adding an ssl_context keyword argument to MongoClient? This might
    #   be useful for sites that have unusual requirements rather than
    #   trying to expose every SSLContext option through a keyword/uri
    #   parameter. 
开发者ID:leancloud,项目名称:satori,代码行数:23,代码来源:ssl_support.py


注:本文中的wincertstore.CertFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。