MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _load_wincerts

Method _load_wincerts

pymongo/pyopenssl_context.py:338–349  ·  view source on GitHub ↗

Attempt to load CA certs from Windows trust store.

(self, store: str)

Source from the content-addressed store, hash-verified

336 )
337
338 def _load_wincerts(self, store: str) -> None:
339 """Attempt to load CA certs from Windows trust store."""
340 cert_store = self._ctx.get_cert_store()
341 assert cert_store is not None
342 oid = _stdlibssl.Purpose.SERVER_AUTH.oid
343
344 for cert, encoding, trust in _stdlibssl.enum_certificates(store): # type: ignore
345 if encoding == "x509_asn":
346 if trust is True or oid in trust:
347 cert_store.add_cert(
348 _crypto.X509.from_cryptography(x509.load_der_x509_certificate(cert))
349 )
350
351 def load_default_certs(self) -> None:
352 """A PyOpenSSL version of load_default_certs from CPython."""

Callers 1

load_default_certsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected