Make SMTP test CA readable by delivery agent

This commit is contained in:
Mario Fetka
2026-07-26 17:09:04 +02:00
parent 4331564222
commit e8b69ae524
@@ -251,6 +251,7 @@ def make_tls_context(directory: Path) -> tuple[ssl.SSLContext, Path]:
key = directory / "server.key"
certificate = directory / "server.crt"
template = directory / "cert.cfg"
directory.chmod(0o755)
template.write_text(
'cn = "smtp08.test"\n'
'dns_name = "*.smtp08.test"\n'
@@ -279,6 +280,7 @@ def make_tls_context(directory: Path) -> tuple[ssl.SSLContext, Path]:
"--outfile",
str(certificate),
])
certificate.chmod(0o644)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.minimum_version = ssl.TLSVersion.TLSv1_2
context.load_cert_chain(certificate, key)