From beb1d53dc0191f87ab40696b9e4045b2082aeabf Mon Sep 17 00:00:00 2001 From: Matthew McPherrin Date: Wed, 8 Nov 2023 22:42:14 -0500 Subject: [PATCH] Make setCommonName go through the addValue path This ensures the CN is present as a SAN --- .../src/main/java/org/shredzone/acme4j/util/CSRBuilder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/util/CSRBuilder.java b/acme4j-client/src/main/java/org/shredzone/acme4j/util/CSRBuilder.java index e3cde461..5e0bc84b 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/util/CSRBuilder.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/util/CSRBuilder.java @@ -213,7 +213,6 @@ public class CSRBuilder { public void addValue(ASN1ObjectIdentifier oid, String value) { if (requireNonNull(oid, "OID must not be null").equals(BCStyle.CN)) { addDomain(value); - return; } namebuilder.addRDN(oid, requireNonNull(value, "attribute value must not be null")); } @@ -224,7 +223,7 @@ public class CSRBuilder { * Note that it is at the discretion of the ACME server to accept this parameter. */ public void setCommonName(String cn) { - namebuilder.addRDN(BCStyle.CN, toAce(requireNonNull(cn))); + addValue(BCStyle.CN, cn); } /**