Make SMTP test CA readable by delivery agent
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user