Skip to content

Commit 516d230

Browse files
authored
Merge pull request #31 from Keyfactor/hotfix
Hotfix
2 parents 01ed1b3 + f9e1564 commit 516d230

6 files changed

Lines changed: 38 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ An API Key within your Digicert account that has the necessary permissions to en
106106
* **Organization-Name** - OPTIONAL: For requests that will not have a subject (such as ACME) you can use this field to provide the organization name. Value supplied here will override any CSR values, so do not include this field if you want the organization from the CSR to be used.
107107
* **RenewalWindowDays** - OPTIONAL: The number of days from certificate expiration that the gateway should do a renewal rather than a reissue. If not provided, default is 90.
108108
* **CertType** - OPTIONAL: The type of cert to enroll for. Valid values are 'ssl' and 'client'. The value provided here must be consistant with the ProductID. If not provided, default is 'ssl'. Ignored for secure_email_* product types.
109+
* **IncludeClientAuthEKU** - OPTIONAL for SSL certs, ignored otherwise. If set to 'true', SSL certs enrolled under this template will have the Client Authentication EKU added to the request. NOTE: This feature is currently planned to be removed by DigiCert in May 2026.
109110
* **EnrollDivisionId** - OPTIONAL: The division (container) ID to use for enrollments against this template.
110111
* **CommonNameIndicator** - Required for secure_email_sponsor and secure_email_organization products, ignored otherwise. Defines the source of the common name. Valid values are: email_address, given_name_surname, pseudonym, organization_name
111-
* **ProfileType** - Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Default value is strict.
112+
* **ProfileType** - Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Use 'multipurpose' if your cert includes any additional EKUs such as client auth. Default if not provided is dependent on product configuration within Digicert portal.
112113
* **FirstName** - Required for secure_email_* types if CommonNameIndicator is given_name_surname, ignored otherwise.
113114
* **LastName** - Required for secure_email_* types if CommonNameIndicator is given_name_surname, ignored otherwise.
114115
* **Pseudonym** - Required for secure_email_* types if CommonNameIndicator is pseudonym, ignored otherwise.

digicert-certcentral-caplugin/API/OrderCertificate.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ public class CertificateRequest
101101

102102
[JsonProperty("ca_cert_id")]
103103
public string CACertID { get; set; }
104+
105+
[JsonProperty("profile_option")]
106+
public string ProfileOption { get; set; }
104107
}
105108

106109
public class CertificateOrderContainer

digicert-certcentral-caplugin/CertCentralCAPlugin.cs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ public async Task<EnrollmentResult> Enroll(string csr, string subject, Dictionar
294294
string priorCertSnString = null;
295295
string priorCertReqID = null;
296296

297+
if (typeOfCert.Equals("ssl") && Convert.ToBoolean(productInfo.ProductParameters[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH]))
298+
{
299+
orderRequest.Certificate.ProfileOption = "server_client_auth_eku";
300+
}
301+
297302
// Current gateway core leaves it up to the integration to determine if it is a renewal or a reissue
298303
if (enrollmentType == EnrollmentType.RenewOrReissue)
299304
{
@@ -584,6 +589,13 @@ public Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
584589
DefaultValue = "ssl",
585590
Type = "String"
586591
},
592+
[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH] = new PropertyConfigInfo()
593+
{
594+
Comments = "OPTIONAL for SSL certs, ignored otherwise. If set to 'true', SSL certs enrolled under this template will have the Client Authentication EKU added to the request. NOTE: This feature is currently planned to be removed by DigiCert in May 2026.",
595+
Hidden = false,
596+
DefaultValue = false,
597+
Type = "Boolean"
598+
},
587599
[CertCentralConstants.Config.ENROLL_DIVISION_ID] = new PropertyConfigInfo()
588600
{
589601
Comments = "OPTIONAL: The division (container) ID to use for enrollments against this template.",
@@ -600,7 +612,7 @@ public Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
600612
},
601613
[CertCentralConstants.Config.PROFILE_TYPE] = new PropertyConfigInfo()
602614
{
603-
Comments = "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Default value is strict.",
615+
Comments = "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Use 'multipurpose' if your cert includes any additional EKUs such as client auth. Default if not provided is dependent on product configuration within Digicert portal.",
604616
Hidden = false,
605617
DefaultValue = "strict",
606618
Type = "String"
@@ -1023,7 +1035,7 @@ public async Task ValidateProductInfo(EnrollmentProductInfo productInfo, Diction
10231035
detailsRequest.ContainerId = null;
10241036
if (connectionInfo.ContainsKey(CertCentralConstants.Config.DIVISION_ID))
10251037
{
1026-
string div = (string)connectionInfo[CertCentralConstants.Config.DIVISION_ID];
1038+
string div = connectionInfo[CertCentralConstants.Config.DIVISION_ID].ToString();
10271039
if (!string.IsNullOrWhiteSpace(div))
10281040
{
10291041
if (int.TryParse($"{div}", out int divId))
@@ -1680,9 +1692,10 @@ private EnrollmentResult EnrollForSmimeCert(string csr, string subject, Dictiona
16801692
}
16811693
}
16821694

1695+
string profile = null;
16831696
if (productInfo.ProductParameters.ContainsKey(CertCentralConstants.Config.PROFILE_TYPE))
16841697
{
1685-
string profile = productInfo.ProductParameters[CertCentralConstants.Config.PROFILE_TYPE].ToString();
1698+
profile = productInfo.ProductParameters[CertCentralConstants.Config.PROFILE_TYPE].ToString();
16861699

16871700
// Only validate if value provided
16881701
if (!string.IsNullOrEmpty(profile))
@@ -1693,6 +1706,10 @@ private EnrollmentResult EnrollForSmimeCert(string csr, string subject, Dictiona
16931706
throw new Exception($"Invalid profile type provided. Valid values are: strict, multipurpose");
16941707
}
16951708
}
1709+
else
1710+
{
1711+
profile = null;
1712+
}
16961713
}
16971714

16981715
if (cnIndic.Equals("given_name_surname", StringComparison.OrdinalIgnoreCase))
@@ -1884,12 +1901,11 @@ private EnrollmentResult EnrollForSmimeCert(string csr, string subject, Dictiona
18841901
orderRequest.Certificate.SignatureHash = certType.signatureAlgorithm;
18851902
orderRequest.Certificate.CACertID = caCertId;
18861903
orderRequest.SetOrganization(organizationId);
1887-
string profileType = "strict";
1888-
if (productInfo.ProductParameters.ContainsKey(Constants.Config.PROFILE_TYPE))
1904+
//If profile type is not provided, use the default on the digicert product configuration
1905+
if (!string.IsNullOrEmpty(profile))
18891906
{
1890-
profileType = productInfo.ProductParameters[Constants.Config.PROFILE_TYPE];
1891-
}
1892-
orderRequest.Certificate.ProfileType = profileType;
1907+
orderRequest.Certificate.ProfileType = profile;
1908+
}
18931909
orderRequest.Certificate.CommonNameIndicator = cnIndicator;
18941910
if (productInfo.ProductID.Equals("secure_email_sponsor", StringComparison.OrdinalIgnoreCase))
18951911
{

digicert-certcentral-caplugin/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class Config
3232
public const string FILTER_EXPIRED = "FilterExpiredOrders";
3333
public const string SYNC_EXPIRATION_DAYS = "SyncExpirationDays";
3434
public const string CERT_TYPE = "CertType";
35+
public const string INCLUDE_CLIENT_AUTH = "IncludeClientAuthEKU";
3536
public const string ENROLL_DIVISION_ID = "EnrollDivisionId";
3637
public const string COMMON_NAME_INDICATOR = "CommonNameIndicator";
3738
public const string PROFILE_TYPE = "ProfileType";

digicert-certcentral-caplugin/digicert-certcentral-caplugin.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
55
<RootNamespace>Keyfactor.Extensions.CAPlugin.DigiCert</RootNamespace>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>disable</Nullable>
88
<AssemblyName>DigicertCAPlugin</AssemblyName>
9+
<AssemblyVersion>2.1.1</AssemblyVersion>
10+
<FileVersion>2.1.1</FileVersion>
911
</PropertyGroup>
1012

1113
<ItemGroup>

integration-manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
"name": "CertType",
7373
"description": "OPTIONAL: The type of cert to enroll for. Valid values are 'ssl' and 'client'. The value provided here must be consistant with the ProductID. If not provided, default is 'ssl'. Ignored for secure_email_* product types."
7474
},
75+
{
76+
"name": "IncludeClientAuthEKU",
77+
"description": "OPTIONAL for SSL certs, ignored otherwise. If set to 'true', SSL certs enrolled under this template will have the Client Authentication EKU added to the request. NOTE: This feature is currently planned to be removed by DigiCert in May 2026."
78+
},
7579
{
7680
"name": "EnrollDivisionId",
7781
"description": "OPTIONAL: The division (container) ID to use for enrollments against this template."
@@ -82,7 +86,7 @@
8286
},
8387
{
8488
"name": "ProfileType",
85-
"description": "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Default value is strict."
89+
"description": "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Use 'multipurpose' if your cert includes any additional EKUs such as client auth. Default if not provided is dependent on product configuration within Digicert portal."
8690
},
8791
{
8892
"name": "FirstName",

0 commit comments

Comments
 (0)