Skip to content

Commit c9ead6d

Browse files
committed
Fix CN missing issue for external CA
1 parent e5a184f commit c9ead6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/src/ee/services/pki-acme/pki-acme-service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,9 @@ export const pkiAcmeServiceFactory = ({
769769
const cert = await orderCertificate(
770770
{
771771
caId: certificateAuthority!.id,
772-
commonName: certificateRequest.commonName!,
772+
// It is possible that the CSR does not have a common name, in which case we use an empty string
773+
// (more likely than not for a CSR from a modern ACME client like certbot, cert-manager, etc.)
774+
commonName: certificateRequest.commonName ?? "",
773775
altNames: certificateRequest.subjectAlternativeNames?.map((san) => san.value),
774776
csr: Buffer.from(csrPem),
775777
// TODO: not 100% sure what are these columns for, but let's put the values for common website SSL certs for now

0 commit comments

Comments
 (0)