Repository navigation
V2 follow-ups round 2: enrollment deadline, report-status conflict, DCV domain lookup cache - #41
Open
spbsoluble wants to merge 5 commits into
Open
spbsoluble wants to merge 5 commits into
spbsoluble wants to merge 5 commits into
Conversation
…ws through Track Order The report row says fulfilled while the certificate status says pending; Track Order returns issued (live: 1125823297). Preferring certificateStatus reported the order as pending and never downloaded the certificate. That one shape (order maps issued, certificate maps pending) now maps to null so the sync asks Track Order, and the pair appears in UnmappedReportStatuses. Other disagreements keep their mapping.
FindSslComDomainAsync called GET /domains for every pending domain on every DCV attempt, so a pass over many orders under one domain repeated the same lookup. A per-pass cache (one per sync pass, one per Enroll/GetSingleRecord DCV call) keeps found rows and "no row"; failed lookups aren't cached and fall back to emSign as before. Only DomainId/validatedBy come from the cached row; DCV state is still read fresh per order. Sync processes rows sequentially, so a plain dictionary.
…entry Command fails the Keyfactor-Enroll workflow step at its global Workflow Step Run Timeout (Workflow.General.Timeout, 60 s by default; the step has no timeout of its own). The pickup budget (5 s + PickupRetries x PickupDelay, capped at 75 s) was counted from the start of the pickup, so the create time came on top: on the lab a new DV order and a reissue (26 s) both reached Command's 60 s, which recorded a failure while the order went on at CERTInext. New setting EnrollmentCallBudgetSeconds (default 50, 0 disables, clamped to 90 under the 100 s HttpClient timeout). Enroll starts an EnrollmentDeadline, carried in an AsyncLocal to the V1 new/renew and V2 pickups. They shorten waits to keep a 3 s poll margin, skip the delay after the last poll, and stop with one Information line when no poll fits. In-flight calls are never cut short; PickupRetries=0 is unchanged; inline DCV is not bounded (documented as a known limitation).
…prover' order Opt-in (CERTINEXT_V2_FULFILLED_PENDING_SYNC=1), read-only. A DispatchProxy narrows the real report listing to one order and forwards every other call to the real client, so the actual Synchronize path runs live. Asserts the row defers to Track Order, comes out issued, and has its certificate download attempted. Live 2026-11-15 on 1125823297: Track issued, download 422 EMS-1165 (never generated), emitted issued without a body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan:
issues/0096-v2-followups-round2-plan.md, items 0-3. Stacked on #40.0. Command's
Keyfactor-Enrolltimeout (investigation, no code)Read-only, against kfclab Command 25.5:
GET /Workflow/Definitionslists one enrollment definition, the built-in "Global Enrollment Workflow" (0d2c4a1e-…, no template key, published v1):StartNOOP→KeyfactorEnroll(EnrollStep) →EndNOOP.GET /Workflow/Definitions/Steps/EnrollStepshows no configuration parameters at all.GET /AppSetting→ Id 208,Workflow.General.Timeout, "Workflow Step Run Timeout (seconds)",Type_Int, value 60. It applies to every workflow step, not per template or definition. Changing it doesn't require publishing a definition.AppSettingResponsehas no min/max), theApplicationSettingsDB row, nor the Command docs (Application Settings: Workflow tab; AnyCAGateway REST "Configure CA Plugin", which tells DCV users to raise it) give a range. The "about 120 s" cap is unconfirmed.CommandEnrollmentBudgetSeconds, from a field log) stays as the upper clamp.Written up in
docsource/configuration.md("Command's workflow step timeout andEnrollmentCallBudgetSeconds").1. Deadline from
EnrollentryEnrollmentCallBudgetSeconds: default 50,0= no deadline, negative → 50, clamped to 90 (under the 100 s HttpClient). Docs say to set it about 10 s below Workflow Step Run Timeout.Enrollstarts anEnrollmentDeadlinefirst thing and carries it in anAsyncLocal. The V1 new-enroll, V1 renew and V2 pickups all read it, with no signature changes.remaining − 3 s(a margin for the poll itself). The delay after the last poll is skipped, because no poll follows it. When no poll fits, the pickup stops and returns pending with one Information line: elapsed, budget, attempts run.PickupRetries=0still disables the pickup.0keeps the old cadence, including the trailing delay.Clock(TimeProvider) andPickupDelayAsync, so the 19 new tests run on a manual clock.2.
Order Fulfilled | Pending for ApproverWhen
orderStatusmaps to issued andcertificateStatusmaps to pending, the mapping returns null, so sync asks Track Order and the pair shows inUnmappedReportStatuses. It's deliberately narrow:Order Accepted | Certificate Revokedand the other disagreeing pairs keep their mapping.Order Accepted | Rejected due to Order Cancellationwas re-checked live (Trackpending-dcvfor 3923286643, 6932127547 and 5519319749) and left alone.3. SSL.com domain lookup cache
One cache per sync pass, and one per
Enroll/GetSingleRecordDCV call: domain (case-insensitive) → row, or "no row". Failures aren't cached. OnlyDomainId/validatedByare read from a cached row; the DCV state is still read fresh per order fromGET /domains/{id}/dcv. Sync processes rows sequentially (await foreach), so a plainDictionary. The cache only exists underSUPPORTS_DCV.Testing
dotnet test CERTInext.Tests -c Release1327 passed (baseline 1296 at a9d4ef6 + 31 new); theDcvSupport=falsebuild runs 1242, all passed.dotnet build -c Release --no-incrementaland the same with-p:DcvSupport=false, 0 warnings / 0 errors each.CERTInextCAPluginV2PickupTests,RenewalPickupDcvTests,V2CertificateNotGeneratedTests.Live results
Item 2:
Sync_UnresolvedReportStatuses_Probe, one read-only run. 1434 report rows; 1125823297 is now under "Unresolved" with Trackstatus=issued. Unresolved went from 6 to 7 rows (the other 6 areOn Hold | Setup Pending).Item 2, end to end:
V2FulfilledPendingSyncLiveTests(new, opt-in, read-only), one run on 2026-11-15. It runs the realSynchronizepath against the live API, with the report listing narrowed to 1125823297 by a forwarding proxy.ListOrdersV2Asyncx1,ResolveAndTrackOrderV2WithFamilyAsyncx1 andResolveAndDownloadCertificateV2Asyncx1.IssuedNotGeneratedYet=1). CERTInext never generated the certificate, even though the order dates from 2026-06-21, before the sandbox stopped generating. The certificate status "Pending for Approver" looks accurate and Track'sissuedlooks wrong. Recorded as an update to Finding 35 inanalysis/v2-api-support-questions.md.Item 1: on kfclab
gateway-certinext, DLL deployed from this branch (net8,DcvSupport=false). Workflow Step Run Timeout was 60 unless noted.AnyCA_DV SSLenrollment, budget 50EXTERNAL_VALIDATION, 51.9 s.Enrolltook 47.7 s: the pickup started at +4.1 s and all 5 polls fit, with only the last wait shortened (order 6292373831).RenewalWindowDays30 → V2 reissueEXTERNAL_VALIDATION, 49.6 s. Reissue POST 20.7 s; pickup started at +21.9 s and was stopped early at 47.3 s, 3 of 5 polls (order 9312165275R001).PickupRetries/PickupDelay(~50 s now) were the binding limit, not the 90 s budget. It shows only that a raised budget doesn't cut a normal pickup short. Seeing the longer wait needs a run withPickupRetriesraised too; I haven't done one.RenewalWindowDaysorEnrollmentCallBudgetSeconds, matching the kfclab spec (V2InlineCsr=true,SignerIpfrom the secret, lookback 72, incremental 60 min, full daily 2:00).issuedwithcertificateState: Approved by System(EMS-1165), so, like PR V2 spec follow-ups: SSL.com DCV, reissue endpoint, revoke fallback, token retry (0094, 0095) #40's stuck orders, they can't be revoked until the sandbox generates certificates again.Item 3: not verifiable on the sandbox (no SSL.com domains).
Open questions
Enrollcan still exceed the step timeout (DcvTimeoutMinutesdefaults to 10). Should it get a follow-up issue to stop DCV polling at the deadline and leave the TXT record for the sync to finish?PickupRetries/PickupDelaychange now that the deadline bounds them? I left them alone.