diff --git a/src/SectigoCAProxy/SectigoCAProxy.cs b/src/SectigoCAProxy/SectigoCAProxy.cs index e99cfe4..774ae43 100644 --- a/src/SectigoCAProxy/SectigoCAProxy.cs +++ b/src/SectigoCAProxy/SectigoCAProxy.cs @@ -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);