Add CN to subject

This will add the first domain as the Common Name (CN) in the subject.
This commit is contained in:
jvermaat 2025-11-25 12:05:56 +01:00 committed by GitHub
parent e9050f1a3c
commit dd433df514
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,7 +88,11 @@ def make_csr(
builder = (
x509.CertificateSigningRequestBuilder()
.subject_name(x509.Name([]))
.subject_name(
x509.Name([
x509.NameAttribute(x509.oid.NameOID.COMMON_NAME, domains[0])
])
)
.add_extension(
x509.SubjectAlternativeName(
[x509.DNSName(d) for d in domains]