Make setCommonName go through the addValue path

This ensures the CN is present as a SAN
pull/145/head
Matthew McPherrin 2023-11-08 22:42:14 -05:00
parent adb512c8df
commit ebf09a643f
No known key found for this signature in database
GPG Key ID: 2A00FFE253AC0A41
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);
}
/**