Skip to content

Commit

Permalink
Merge pull request #17 from Keyfactor/optionalsubjectchecks
Browse files Browse the repository at this point in the history
Allow optional department
  • Loading branch information
dgaley authored Jun 14, 2022
2 parents e1a9129 + d3bf96e commit 6d5a88b
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 6d5a88b

Please sign in to comment.