MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / from_files

Method from_files

mitmproxy/certs.py:532–545  ·  view source on GitHub ↗
(
        cls, ca_file: Path, dhparam_file: Path, passphrase: bytes | None = None
    )

Source from the content-addressed store, hash-verified

530
531 @classmethod
532 def from_files(
533 cls, ca_file: Path, dhparam_file: Path, passphrase: bytes | None = None
534 ) -> "CertStore":
535 raw = ca_file.read_bytes()
536 key = load_pem_private_key(raw, passphrase)
537 dh = cls.load_dhparam(dhparam_file)
538 certs = x509.load_pem_x509_certificates(raw)
539 ca = Cert(certs[0])
540 crl = dummy_crl(key, ca._cert)
541 if len(certs) > 1:
542 chain_file: Path | None = ca_file
543 else:
544 chain_file = None
545 return cls(key, ca, chain_file, crl, dh)
546
547 @staticmethod
548 @contextlib.contextmanager

Callers 2

test_sslkeylogfileFunction · 0.80
from_storeMethod · 0.80

Calls 4

load_pem_private_keyFunction · 0.85
CertClass · 0.85
dummy_crlFunction · 0.85
load_dhparamMethod · 0.80

Tested by 1

test_sslkeylogfileFunction · 0.64