Make setCommonName go through the addValue path

This ensures the CN is present as a SAN
pull/147/head
Matthew McPherrin 2023-11-08 22:42:14 -05:00 committed by Richard Körber
parent 78ccae6bc9
commit beb1d53dc0
1 changed files with 1 additions and 2 deletions

View File

@ -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);
}
/**