Exemplo n.º 1
0
def fixture_ca(
    mocker: MockerFixture,
    tmp_path: Path,
) -> CertificateAuthority:
    ca = CertificateAuthority(tmp_path / "ca", "test-ca")
    ca.initialize()
    mocker.patch(
        "agent_receiver.certificates.ROOT_CERT",
        ca._root_cert_path,
    )
    return ca
Exemplo n.º 2
0
def fixture_untrusted_cert(tmp_path: Path) -> Certificate:
    ca2 = CertificateAuthority(tmp_path / "ca-2", "test-ca-2")
    ca2.initialize()
    cert, _priv_key = ca2._certificate_from_root("abc123")
    return cert
Exemplo n.º 3
0
def fixture_ca(tmp_path: Path) -> CertificateAuthority:
    ca_path = tmp_path / "ca"
    return CertificateAuthority(
        root_ca=RootCA.load_or_create(root_cert_path(ca_path), CA_NAME),
        ca_path=ca_path,
    )
Exemplo n.º 4
0
def ca(tmp_path):
    p = tmp_path / "etc" / "ssl"
    return CertificateAuthority(root_ca=RootCA.load_or_create(
        root_cert_path(p), "ca-name"),
                                ca_path=p)