Skip to content

Commit

Permalink
Allow optional department
Browse files Browse the repository at this point in the history
  • Loading branch information
dgaley committed Jun 14, 2022
1 parent aba6f8b commit d3bf96e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SectigoCAProxy/SectigoCAProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe

string ouStr = ParseSubject(subject, "OU=", false);

string department = productInfo.ProductParameters["Department"];
Logger.Trace($"Department: {department}");
string department = null;
if (productInfo.ProductParameters.ContainsKey("Department"))
{
department = productInfo.ProductParameters["Department"];
Logger.Trace($"Department: {department}");
}

var fieldList = Task.Run(async () => await Client.ListCustomFields()).Result;
var mandatoryFields = fieldList.CustomFields?.Where(f => f.mandatory);
Expand Down

0 comments on commit d3bf96e

Please sign in to comment.