Skip to content

fix(v2): stop sending or checking product codes; take extra names only from Command's SAN list - #50

Merged
spbsoluble merged 12 commits into
feat/v2-consolidatedfrom
fix/v2-wildcard-ucc-fail-open
Nov 17, 2026
Merged

spbsoluble merged 12 commits into
feat/v2-consolidatedfrom
fix/v2-wildcard-ucc-fail-open

Conversation

@spbsoluble

@spbsoluble spbsoluble commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

CERTInext has told us not to send the X-Product-Code header on V2 order create. Clients should send only the variant (productVariant, e.g. dv) and let CERTInext pick the product. This PR makes the V2 plugin follow that guidance, stop checking product codes itself, and take an order's extra names only from Command's SAN list:

  • No ProductCode on the template: the header is never sent.
  • ProductCode set on the template: it's sent as given. The plugin doesn't check it against the catalog, neither when the template is saved nor at enrollment. If the code is wrong, CERTInext rejects the order and the error comes back to the user.
  • SAN source: Command's SAN list (passed by the gateway) decides whether an order is multi-domain and fills additionalDomains. A DNS name that is only in the CSR is ignored, and the CSR itself is still sent unchanged. That's what the other Keyfactor CA plugins that build a SAN list for their CA do (DigiCert, Entrust, Sectigo, GlobalSign, ...).

The plugin used to look products up in the CERTInext catalog by productTypeID and reject requests based on what it found. That caused problems on accounts whose catalogs don't use those IDs, such as SSL.com-backed accounts. One example: a request with CN example.com and SANs example.com and *.example.com was rejected without ever reaching CERTInext.

Request Before After
No ProductCode, wildcard only in the SANs Catalog lookup; sends a Wildcard UCC code, or rejects the request if none is found No catalog call and no header. The CN is the domain and the wildcard goes in additionalDomains
ProductCode set, extra SANs, catalog lists the code as single-domain Rejected before ordering Placed with the extras in additionalDomains; CERTInext decides
Template save with a ProductCode (SSL or Private PKI) Code must be in the catalog with a matching productTypeID No catalog check
A DNS name only in the CSR, not in Command's SAN list Order marked multi-domain, but the name was left out of additionalDomains Ignored. The order is sized by Command's SAN list, and the CSR is sent unchanged
EV request with a wildcard Rejected for a wildcard SAN only Sent to CERTInext, which decides
Any V1 request n/a Unchanged

Fixes

  • Enrollment (EnrollV2CoreAsync):
    • Removed every catalog read.
    • Wildcard/UCC is now decided from the request for every SSL order: a domain starting *., a UCC template product, or extra DNS names in Command's SAN list, which go in additionalDomains.
    • Removed the single-domain SAN guard and the EV wildcard check.
  • SAN source (FindExtraDnsSans): now uses the same source as additionalDomains (CollectRequestedSanEntries): Command's SAN list, or the CSR only when the gateway passes no list. It used to take the union of the CSR and the SAN list. BuildSanList, which V1 also uses, is unchanged.
  • Template save (ValidateProductInfo):
    • V2 no longer looks the ProductCode up in the catalog, for SSL or Private PKI.
    • The ProductVariant, Private PKI variant and OV organization representative checks stay.
    • V1's GetProfilesAsync check is unchanged.
  • Catalog parsing (ParseProductDetailsV2Response, used by sync): a numeric productTypeID in a flat row no longer fails the catalog read. On those rows, active is honored only as JSON true/false; a missing or null value counts as available.

Chores

  • Removed unused constants: WildcardUccProductTypeIdByVariant, WildcardProductTypeIds and PrivatePkiProductTypeId.
  • Cleared a CS8602 nullable warning in the SSL.com organization check.
  • The multi-domain enrollment log line no longer says the plugin "resolved" a product.
  • Docs updated to describe the new behavior:
    • docsource/configuration.md: V2 product code resolution and SAN source, plus a note that some accounts reject a wildcard-only-in-SANs request with EMS-1173, and that setting ProductCode works around it. Private PKI orders too.
    • docsource/architecture.md: V2 enroll flowchart, product-code notes and template validation.
    • docsource/migration-v1-to-v2.md.
  • CHANGELOG.md (2.0.0):
    • The two overlapping ProductCode / X-Product-Code feature entries are merged into one that describes the final behavior.
    • New fix entries cover the wildcard-in-SANs request, explicit codes with extra SANs, and the SAN source.
    • A new known limitation: EMS-1173 on wildcard-only-in-SANs requests on some accounts.
    • Test-environment references and meta notes removed from the 2.0.0 entries.
  • Live test tooling, all opt-in:
    • V2WildcardSanShapeTests.Probe_Raw_ApexCn_WildcardSan sends the create request directly, with no X-Product-Code.
    • PrivatePkiV2LiveTests takes two new switches, CERTINEXT_PRIVATE_PKI_VARIANT and CERTINEXT_PRIVATE_PKI_LEAVE_PENDING, and routes plugin logs to the test output.
    • DcvLifecycleTests.EnrollWithoutDcv_DoesNotInvokeDnsProvider routes plugin logs and prints the result.

Testing

  • Unit tests: 1401 passed, 0 failed (CERTInext.Tests, Release).
  • Release build: 0 warnings.
  • Tests that asserted the removed pre-checks were changed to assert the new behavior:
    • V2 template save with an explicit code passes without calling the catalog, whatever the catalog would return (code present or missing, empty, HTTP 500, type mismatch, undocumented type). Covered for SSL and Private PKI.
    • An explicit code is sent as given with no catalog call, across several codes and request shapes.
    • A wildcard SAN on a plain CN sends no code (DV and OV).
    • EV with a wildcard SAN or a wildcard domain is sent to CERTInext.
  • New:
    • FindExtraDnsSans takes names only from Command's SAN list: a CSR-only name is ignored whether the list holds only the primary domain or is empty. The CSR is used only when there is no list, and names that are only in the list are kept.
    • An enrollment whose CSR has a name Command didn't send is placed as a single-domain order with the CSR unchanged.
    • Flat catalog rows: a numeric productTypeID, and active given as missing, false, "false", 0 or null.

Other

Stacked on #39 (feat/v2-consolidated).

spbsoluble and others added 4 commits November 17, 2026 10:23
…a Wildcard UCC product

A DV/OV request with CN = apex and SAN = *.apex and no template ProductCode
was rejected before ordering whenever the catalog didn't list exactly one
active product with productTypeID 21/22. Catalogs on other CA backends
(SSL.com) need not use those IDs, and there CERTInext accepts this shape
with no X-Product-Code. Now:

- One active Wildcard UCC product: its code is sent, as before.
- None, several, or an unreadable catalog: a warning is logged and the
  order is placed with no X-Product-Code. An EMS-1173 from CERTInext then
  says to set ProductCode on the template. EV still fails before ordering.
- Explicit ProductCode whose catalog entry has no documented SSL
  productTypeID (not listed, none, unfamiliar, or no catalog): UCC is
  decided from the request's SANs instead of rejecting extra SANs, and
  template save-time validation accepts the code instead of reporting a
  product mismatch.
- Flat catalog rows keyed by productCode are available when they carry no
  "active" field, and a numeric productTypeID no longer fails the read.

Also clears a CS8602 on the SSL.com organization check (the variant is
"ov" or "ev" there).
… switches, V1 enroll logging

- V2WildcardSanShapeTests.Probe_Raw_ApexCn_WildcardSan posts the create
  body directly (no X-Product-Code, CSR inline, CN = apex, SAN = *.apex),
  with and without additionalDomains.
- PrivatePkiV2LiveTests routes plugin logs to the test output and takes
  CERTINEXT_PRIVATE_PKI_VARIANT and CERTINEXT_PRIVATE_PKI_LEAVE_PENDING.
- DcvLifecycleTests.EnrollWithoutDcv_DoesNotInvokeDnsProvider routes
  plugin logs and prints the enroll result.
…e ProductCode as given

CERTInext advises sending only the variant and leaving X-Product-Code out.
Removes the catalog lookup that pinned a Wildcard UCC product (typeID 21/22)
for a wildcard SAN on a plain CN, along with its no-match fallback and
EMS-1173 hint. That request now goes out like any other: CN as the domain,
the wildcard in additionalDomains, no header unless the template sets
ProductCode, no catalog call. EV with a wildcard SAN is still rejected
before ordering. Drops the now-unused WildcardUccProductTypeIdByVariant.
@spbsoluble spbsoluble changed the title fix(v2): don't block wildcard-SAN orders when the catalog can't name a Wildcard UCC product fix(v2): never add X-Product-Code on the plugin's own; send a template ProductCode as given Nov 17, 2026
github-actions Bot and others added 2 commits November 17, 2026 18:39
…de it can't use

V2 no longer checks a template ProductCode against the catalog:

- Enrollment never reads the catalog. Wildcard/UCC is decided from the
  request for every SSL order (domain "*.", UCC template product, or extra
  DNS SANs going out in additionalDomains), with or without ProductCode.
  The single-domain SAN guard, which could only reject an explicit code the
  catalog listed as non-UCC, is gone. An explicit code is sent as given.
- Template save (ValidateProductInfo) no longer looks the code up in the
  V2 catalog, for SSL or Private PKI. The ProductVariant, Private PKI
  variant and OV organization representative checks stay.
- EV with a wildcard SAN is still rejected before ordering.

V1 is unchanged: its template save still checks the code with
GetProfilesAsync. Drops the now-unused WildcardProductTypeIds and
PrivatePkiProductTypeId constants.
@spbsoluble spbsoluble changed the title fix(v2): never add X-Product-Code on the plugin's own; send a template ProductCode as given fix(v2): stop sending or checking product codes; send a template ProductCode as given Nov 17, 2026
github-actions Bot and others added 3 commits November 17, 2026 19:10
…dress review findings

SAN source: FindExtraDnsSans took the union of the CSR's SANs and the
gateway's SAN dictionary, while additionalDomains came from the dictionary.
A DNS name only in the CSR made the order multi-domain yet was left out of
additionalDomains. Both now use CollectRequestedSanEntries: the dictionary,
or the CSR only when the dictionary is null. That matches the other
Keyfactor CA plugins that build a SAN list for their CA (DigiCert, Entrust,
Vault, GCP CAS, GoDaddy, Sectigo, GlobalSign, HydrantID, SSLStore, CSC):
dictionary only, CSR passed through, no union and no rejection.
BuildSanList, which V1 also uses, is unchanged.

Review findings:
- Drop the EV wildcard pre-check (it covered only a wildcard SAN, not a
  wildcard domain); CERTInext decides.
- Flat catalog rows: "active" is honored only as JSON true/false; a
  missing or null value is available, anything else isn't. The CHANGELOG
  no longer claims an Active fix (nothing reads it).
- The UCC log line no longer says the plugin "resolved" a product.
- Docs note that some accounts reject a wildcard-only-in-SANs request
  with EMS-1173, and that ProductCode is the way around it.
- Catalog_ListsProductTypeIds comment: informational only.
@spbsoluble spbsoluble changed the title fix(v2): stop sending or checking product codes; send a template ProductCode as given fix(v2): stop sending or checking product codes; take extra names only from Command's SAN list Nov 17, 2026
spbsoluble and others added 3 commits November 17, 2026 12:00
…ade note and known limitations

Merges the two overlapping X-Product-Code/ProductCode feature entries into one
that describes the final behavior, tightens the related fixes, adds an upgrade
note for earlier 2.0 builds (no save-time ProductCode check; CSR-only SAN names
ignored), and lists EMS-1173 on wildcard-only-in-SANs requests and the missing
live verification as known limitations.
… 2.0.0

Removes sandbox and live-test references, test dates, rationale asides and
the notes aimed at pre-release builds from the 2.0.0 entries, and the same
sandbox aside from the configuration doc.
@spbsoluble
spbsoluble merged commit b8b6d7d into feat/v2-consolidated Nov 17, 2026
@spbsoluble
spbsoluble deleted the fix/v2-wildcard-ucc-fail-open branch November 17, 2026 20:04
spbsoluble added a commit that referenced this pull request Nov 17, 2026
#51)

PR #50 removed V2's save-time ProductCode catalog check and the single-domain
SAN guard, but two live tests still described or asserted them:

- V2ApiTests.ValidateProductInfo_V2_RejectsUnknownProductCode expected an
  unknown code to be rejected at template save. Renamed to
  ValidateProductInfo_V2_AcceptsUnknownProductCode_WithoutCatalogCheck and
  now asserts it's accepted; ValidateProductInfo_V2_AcceptsConfiguredProductCode's
  reason no longer says the code must be in the catalog.
- V2FullLifecycleTests.Enroll_V2_WildcardDv_WildcardPlusApexSan_RecordsActualBehavior
  no longer attributes a FAILED result to the removed guard; it logs the
  result and cleans up any order created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant