mirror of
https://github.com/shred/acme4j.git
synced 2025-12-16 11:24:01 +08:00
Make the Common Name optional in CSRs
This change doesn't set it by default when adding domains, and adds a method to explicitly set it if desired.
This commit is contained in:
committed by
Richard Körber
parent
e26f8fc572
commit
1cf53b6cf4
@@ -78,11 +78,7 @@ public class CSRBuilder {
|
||||
* Domain name to add
|
||||
*/
|
||||
public void addDomain(String domain) {
|
||||
var ace = toAce(requireNonNull(domain));
|
||||
if (namelist.isEmpty()) {
|
||||
namebuilder.addRDN(BCStyle.CN, ace);
|
||||
}
|
||||
namelist.add(ace);
|
||||
namelist.add(toAce(requireNonNull(domain)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,6 +218,15 @@ public class CSRBuilder {
|
||||
namebuilder.addRDN(oid, requireNonNull(value, "attribute value must not be null"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the common name
|
||||
* <p>
|
||||
* 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)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the organization.
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user