diff --git a/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs b/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs index 16fd258..234d2ae 100644 --- a/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs +++ b/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs @@ -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); } // --------------------------------------------------------------------- diff --git a/cscglobal-caplugin/CSCGlobalCAPlugin.cs b/cscglobal-caplugin/CSCGlobalCAPlugin.cs index 33d2306..c7c62cb 100644 --- a/cscglobal-caplugin/CSCGlobalCAPlugin.cs +++ b/cscglobal-caplugin/CSCGlobalCAPlugin.cs @@ -845,8 +845,16 @@ public Dictionary GetTemplateParameterAnnotations() //done public List 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