(
self,
cafile: str | None = None,
capath: str | None = None,
cadata: bytes | None = None,
)
| 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, |
no outgoing calls