我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wincertstore.CertFile.__init__()。
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) _wincerts = MyCertFile(stores=['CA', 'ROOT']) return _wincerts.name
def __init__(self, ca_bundle): self.ca_bundle = ca_bundle HTTPSHandler.__init__(self)
def __init__(self, host, ca_bundle, **kw): HTTPSConnection.__init__(self, host, **kw) self.ca_bundle = ca_bundle
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