def test_auth_and_install_with_csr(context): """Test certificate issuance and install using an existing CSR.""" certname = context.get_domain('le3') key_path = join(context.workspace, 'key.pem') csr_path = join(context.workspace, 'csr.der') misc.generate_csr([certname], key_path, csr_path) cert_path = join(context.workspace, 'csr', 'cert.pem') chain_path = join(context.workspace, 'csr', 'chain.pem') context.certbot([ 'auth', '--csr', csr_path, '--cert-path', cert_path, '--chain-path', chain_path ]) print(misc.read_certificate(cert_path)) print(misc.read_certificate(chain_path)) context.certbot([ '--domains', certname, 'install', '--cert-path', cert_path, '--key-path', key_path ])
def test_ecdsa(context): """Test certificate issuance with ECDSA key.""" key_path = join(context.workspace, 'privkey-p384.pem') csr_path = join(context.workspace, 'csr-p384.der') cert_path = join(context.workspace, 'cert-p384.pem') chain_path = join(context.workspace, 'chain-p384.pem') misc.generate_csr([context.get_domain('ecdsa')], key_path, csr_path, key_type=misc.ECDSA_KEY_TYPE) context.certbot(['auth', '--csr', csr_path, '--cert-path', cert_path, '--chain-path', chain_path]) certificate = misc.read_certificate(cert_path) assert 'ASN1 OID: secp384r1' in certificate
def test_ecdsa(context: IntegrationTestsContext) -> None: """Test issuance for ECDSA CSR based request (legacy supported mode).""" key_path = join(context.workspace, 'privkey-p384.pem') csr_path = join(context.workspace, 'csr-p384.der') cert_path = join(context.workspace, 'cert-p384.pem') chain_path = join(context.workspace, 'chain-p384.pem') misc.generate_csr( [context.get_domain('ecdsa')], key_path, csr_path, key_type=misc.ECDSA_KEY_TYPE ) context.certbot([ 'auth', '--csr', csr_path, '--cert-path', cert_path, '--chain-path', chain_path, ]) certificate = misc.read_certificate(cert_path) assert 'ASN1 OID: secp384r1' in certificate