Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,14 +1154,19 @@ public void GetTemplateParameterAnnotations_ContainsExpectedKeys()
}

[Fact]
public void GetProductIds_ReturnsFullList()
public void GetProductIds_ReturnsCanonicalAndLegacyNames()
{
var plugin = MakePlugin();
var ids = plugin.GetProductIds();

Assert.Equal(10, ids.Count);
// Command uses this list to auto-resolve a CA for a template when none is explicitly
// selected, so pre-1.2.0 legacy-named templates need their names advertised here too,
// not just the 10 canonical names.
Assert.Equal(17, ids.Count);
Assert.Contains("CSC TrustedSecure OV", ids);
Assert.Contains("CSC TrustedSecure DV Wildcard, Multiple Names", ids);
Assert.Contains("CSC TrustedSecure EV Certificate", ids);
Assert.Contains("CSC TrustedSecure Domain Validated SSL", ids);
}

// ---------------------------------------------------------------------
Expand Down
12 changes: 10 additions & 2 deletions cscglobal-caplugin/CSCGlobalCAPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,16 @@ public Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
//done
public List<string> GetProductIds()
{

return ProductIDs.productIds;
// Command uses this list to auto-resolve a CA for a template when none is explicitly
// selected (matches a template's product ID against each CA's advertised list). Existing
// Certificate Templates created before the 1.2.0 product rename are still configured with
// the pre-1.2.0 legacy names, so those must be advertised here too, or auto-resolution
// fails for them with "No CA was found to issue the specified template" even though
// explicit CA selection still works (that path goes through the more lenient
// ValidateProductInfo, which already accepts legacy names via legacyProductIdAliases).
return ProductIDs.productIds
.Concat(ProductIDs.legacyProductIdAliases.Keys)
.ToList();
}

#region PRIVATE
Expand Down
Loading