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

Method add_cert

mitmproxy/certs.py:652–662  ·  view source on GitHub ↗

Adds a cert to the certstore. We register the CN in the cert plus any SANs, and also the list of names provided as an argument.

(self, entry: CertStoreEntry, *names: str)

Source from the content-addressed store, hash-verified

650 self.add_cert(CertStoreEntry(cert, private_key, path, chain), spec)
651
652 def add_cert(self, entry: CertStoreEntry, *names: str) -> None:
653 """
654 Adds a cert to the certstore. We register the CN in the cert plus
655 any SANs, and also the list of names provided as an argument.
656 """
657 if entry.cert.cn:
658 self.certs[entry.cert.cn] = entry
659 for i in entry.cert.altnames:
660 self.certs[str(i.value)] = entry
661 for i in names:
662 self.certs[i] = entry
663
664 @staticmethod
665 def asterisk_forms(dn: str | x509.GeneralName) -> list[str]:

Callers 1

add_cert_fileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected