Skip to content

Commit 2406f13

Browse files
Make cert request CN optional and disabled by default.
1 parent 44128bb commit 2406f13

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Certify.Models/Config/CertRequestConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ public CertRequestConfig()
178178
/// </summary>
179179
public bool EnableFailureNotifications { get; set; } = true;
180180

181+
/// <summary>
182+
/// If true , indicates CN should be set in the CSR
183+
/// </summary>
184+
public bool? IncludeCN { get; set; } = default!;
185+
181186
/// <summary>
182187
/// In the case of ACME, the primary challenge type this request will use (eg. http-01)
183188
/// </summary>

src/Certify.Providers/ACME/Anvil/AnvilACMEProvider.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,10 +1556,14 @@ public async Task<ProcessStepResult> CompleteCertificateRequest(ILog log, Manage
15561556

15571557
var csrInfo = new CsrInfo
15581558
{
1559-
CommonName = includeCommonName ? (commonNameIsDns ? _idnMapping.GetAscii(config.PrimaryDomain) : config.PrimaryDomain) : null,
15601559
RequireOcspMustStaple = config.RequireOcspMustStaple
15611560
};
15621561

1562+
if (config.IncludeCN == true)
1563+
{
1564+
csrInfo.CommonName = includeCommonName ? (commonNameIsDns ? _idnMapping.GetAscii(config.PrimaryDomain) : config.PrimaryDomain) : null;
1565+
}
1566+
15631567
order = await orderContext.Finalize(csrInfo, csrKey);
15641568
}
15651569
}

0 commit comments

Comments
 (0)