MCPcopy
hub / github.com/urllib3/urllib3 / load_verify_locations

Method load_verify_locations

src/urllib3/contrib/pyopenssl.py:462–477  ·  view source on GitHub ↗
(
        self,
        cafile: str | None = None,
        capath: str | None = None,
        cadata: bytes | None = None,
    )

Source from the content-addressed store, hash-verified

460 self._ctx.set_cipher_list(ciphers)
461
462 def load_verify_locations(
463 self,
464 cafile: str | None = None,
465 capath: str | None = None,
466 cadata: bytes | None = None,
467 ) -> None:
468 if cafile is not None:
469 cafile = cafile.encode("utf-8") # type: ignore[assignment]
470 if capath is not None:
471 capath = capath.encode("utf-8") # type: ignore[assignment]
472 try:
473 self._ctx.load_verify_locations(cafile, capath)
474 if cadata is not None:
475 self._ctx.load_verify_locations(BytesIO(cadata))
476 except OpenSSL.SSL.Error as e:
477 raise ssl.SSLError(f"unable to load trusted certificates: {e!r}") from e
478
479 def load_cert_chain(
480 self,

Calls

no outgoing calls