Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5e84e8c
feat(dcv): V2 DCV for SSL.com-validated domains via the domain-level …
spbsoluble Nov 13, 2026
5a30826
fix(revoke): retry rejected privilege-withdrawn as cessation-of-opera…
spbsoluble Nov 13, 2026
56633e2
docs(revoke): describe the 2.0.0 V2 SSL/TLS revoke enum accurately (0…
spbsoluble Nov 13, 2026
f7766e9
fix(v2): serialize the organization pre-vetting token as the spec's p…
spbsoluble Nov 13, 2026
8486405
feat(v2): SSL/TLS reissue via POST /ssl-certificates/{orderId}/reissu…
spbsoluble Nov 13, 2026
07d119a
fix(v2): retry the OAuth2 token request on transport failure; log the…
spbsoluble Nov 13, 2026
1782375
test(v2): live probes for report-status mapping and per-reason revoke…
spbsoluble Nov 14, 2026
af91cf7
docs(tests): document the V2 spec follow-up opt-in probes
spbsoluble Nov 14, 2026
d6b54cd
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 14, 2026
ae97214
fix(sync): skip report-listed V2 orders Track Order can't find, inste…
spbsoluble Nov 14, 2026
a9d4ef6
fix(sync): name unmapped /reports/orders status pairs in the V2 sync …
spbsoluble Nov 14, 2026
9002c67
fix(sync): resolve 'Order Fulfilled | Pending for Approver' report ro…
spbsoluble Nov 14, 2026
f806c4d
fix(dcv): look each SSL.com-candidate domain up once per V2 sync pass
spbsoluble Nov 14, 2026
0ab574d
fix(enroll): bound the in-call pickup wait by a deadline from Enroll …
spbsoluble Nov 14, 2026
f37a6e9
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 14, 2026
6880db3
feat(v2): register a new OV Organization Representative from template…
spbsoluble Nov 15, 2026
1969dbc
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 15, 2026
33681ec
test(live): run the V2 sync for one 'Order Fulfilled | Pending for Ap…
spbsoluble Nov 15, 2026
507d42f
fix(sync): keep 'Order Fulfilled | Pending for Approver' pending when…
spbsoluble Nov 16, 2026
f7d0775
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 16, 2026
3dd45f0
fix(v2): GetSingleRecord returns pending for an issued order with no …
spbsoluble Nov 16, 2026
fcdb49d
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 16, 2026
410d305
test(live): GetSingleRecord returns pending for issued orders with no…
spbsoluble Nov 16, 2026
ed2ceba
docs(v2): CertificateState comment reflects its one use in GetSingleR…
spbsoluble Nov 16, 2026
e993294
fix(sync): report the product name as ProductID so the gateway can as…
spbsoluble Nov 16, 2026
e31b3f9
test(live): probe an order's report row, mapping and Track status (re…
spbsoluble Nov 16, 2026
42f70d8
fix(sync): emit a cancelled/rejected order as failed when the gateway…
spbsoluble Nov 16, 2026
187841a
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 16, 2026
9a42f07
fix(v2): resolve a Wildcard UCC product for a wildcard SAN on a non-w…
spbsoluble Nov 17, 2026
ceb2187
docs: auto-generate README and documentation [skip ci]
github-actions[bot] Nov 17, 2026
087554f
Merge PR #42 (feat/v2-ov-org-representative) into feat/v2-spec-followups
spbsoluble Nov 17, 2026
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
18 changes: 17 additions & 1 deletion CERTInext.IntegrationTests/INTEGRATION_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,26 @@ test that "passes" with the order still pending tells you nothing.
| No `X-Product-Code`: two-call CSR submit returns 422 "PFX based certificate orders are not allowed" | CERTInext resolved the product to one that doesn't take a client CSR (on the sandbox, DV resolves to `917`, not `842`) | The create response's `resolvedProductCode` (logged as `ResolvedProductCode=`). Pin `ProductCode` on the template. |
| No `X-Product-Code`: `GET .../dcv` returns 422 `EMS-1164 Domain Name is not matching`, and `certificateState` is "System Error" | Same product resolution as the row above. It isn't the domain or its letter case. | Pin 842 on the same domain shape; the order issues. |
| Two-call, pinned: `PUT .../csr` returns 422 "Something went Wrong." | The domain is already validated, so the create came back `issued` with `csrSubmitted: false` and the order won't accept a CSR | Trace payloads show the create response. Use `V2InlineCsr=true`, the default since 2.0. |
| `V2 OAuth2 token acquisition failed ... HttpStatus=0` (enroll, sync, or config save returns 500 "could not connect to CERTInext") | A transient transport failure to the token endpoint. The plugin currently logs no transport detail and doesn't retry the token request; a fix is planned. | Retry once. From a gateway pod, test with `curl --cacert /etc/pki/tls/certs/ca-bundle.crt` (the lab pod's `SSL_CERT_FILE` trusts only the lab CA, so plain curl fails TLS even when .NET works). |
| `V2 OAuth2 token acquisition failed: no HTTP response after 3 attempt(s)` (enroll, sync, or config save returns 500 "could not connect to CERTInext") | A transport failure to the token endpoint that outlasted the plugin's two retries (1 s, 3 s). The line's `TransportDetail=` names the error, such as connection reset, TLS, or DNS. Builds before issue 0095 logged only `HttpStatus=0` and didn't retry. | Retry once. From a gateway pod, test with `curl --cacert /etc/pki/tls/certs/ca-bundle.crt` (the lab pod's `SSL_CERT_FILE` trusts only the lab CA, so plain curl fails TLS even when .NET works). |
| Unpinned (`V2Template`) rows fail while pinned rows pass | Expected on the sandbox until CERTInext changes how it resolves DV | See the 917 rows above. |

Before blaming the plugin, separate CA-side from plugin-side failures: run the same request **pinned**,
on a **fresh** name under the validated parent zone, and with the CSR **inline**. Change one variable
at a time. Record confirmed spec-vs-live discrepancies as dated Findings in the CERTInext
support-questions list kept with the maintainers.

## V2 spec follow-up probes (issues 0094/0095)

`V2SpecFollowupsLiveTests` holds one opt-in test per follow-up, each on top of `CERTINEXT_USE_V2_API=1`:

| Flag | Test | Touches |
|---|---|---|
| `CERTINEXT_V2_SSLCOM_DCV_PROBE=1` | `SslComDomainDcv_LookupAndShape_Probe` | Read-only |
| `CERTINEXT_V2_UNRESOLVED_STATUS_PROBE=1` | `Sync_UnresolvedReportStatuses_Probe` | Read-only |
| `CERTINEXT_V2_REVOKE_PRIVILEGE_WITHDRAWN=1` | `Revoke_PrivilegeWithdrawn_OwnOrder_ReportsCaAcceptance` | Places and revokes its own order |
| `CERTINEXT_V2_REVOKE_REASON_PROBE_ORDER_ID=<own order>` | `Revoke_ReasonAcceptance_OwnOrder_Probe` | Sends each revoke reason to that order |
| `CERTINEXT_V2_FULL_SYNC_PROBE=1` | `Sync_V2_FullSync_Summary_Probe` | Read-only (downloads issued certificates) |
| `CERTINEXT_V2_LIFECYCLE_REISSUE_ENDPOINT=1` + `CERTINEXT_V2_REISSUE_SOURCE_ORDER_ID=<issued order>` | `Reissue_V2_ReissueEndpoint_DerivedOrder_Report` | Creates a derived order, then cleans it up |

On a sandbox that has stopped generating certificates, the cleanup of an order the test created can fail with "Certificate Request still being processed". Clean such orders up later with `CERTINEXT_V2_CLEANUP_ORDERS`.

2 changes: 2 additions & 0 deletions CERTInext.IntegrationTests/IntegrationTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public sealed class IntegrationTestFixture : IDisposable
"CERTINEXT_V2_INLINE_CSR_EXPERIMENT",
// V2 certificate-lifetime probe (V2ValidityProbeTests) — places real sandbox orders.
"CERTINEXT_PROBE_VALIDITY",
// Wildcard-in-the-SANs shape probe (V2WildcardSanShapeTests) — places real sandbox orders.
"CERTINEXT_V2_WILDCARD_SAN_PROBE",
};

// ---------------------------------------------------------------------------
Expand Down
126 changes: 126 additions & 0 deletions CERTInext.IntegrationTests/SyncProductIdLiveTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Copyright 2026 Keyfactor
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
// and limitations under the License.

using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Keyfactor.Extensions.CAPlugin.CERTInext.API;
using Keyfactor.Extensions.CAPlugin.CERTInext.Client;
using Xunit;
using Xunit.Abstractions;

namespace Keyfactor.Extensions.CAPlugin.CERTInext.IntegrationTests
{
/// <summary>
/// Issue 0097: the sync's <c>ProductID</c> must be a product name the gateway's templates use. These read-only
/// probes show how each account catalog maps product codes to <c>productTypeID</c>, which the plugin resolves
/// to a name. Opt-in: <c>CERTINEXT_SYNC_PRODUCTID_PROBE=1</c>.
/// </summary>
public class SyncProductIdLiveTests : IClassFixture<IntegrationTestFixture>
{
private readonly IntegrationTestFixture _fixture;
private readonly ITestOutputHelper _output;
private readonly Dictionary<string, string> _env;

public SyncProductIdLiveTests(IntegrationTestFixture fixture, ITestOutputHelper output)
{
_fixture = fixture;
_output = output;
_env = V2EnvHelper.LoadAndPromote();
}

private void Print(string api, List<ProductDetail> products)
{
_output.WriteLine($"{api} catalog: {products?.Count ?? 0} products");
foreach (var p in (products ?? new List<ProductDetail>()).OrderBy(p => p.ProductTypeId).ThenBy(p => p.ProductCode))
{
string name = CERTInextCAPlugin.ProductNameForTypeId(p.ProductTypeId) ?? "(no plugin product)";
_output.WriteLine($" code={p.ProductCode,-6} typeId={p.ProductTypeId,-4} active={p.Active,-5} " +
$"-> {name,-36} catalogName='{p.ProductName}'");
}
}

[SkippableFact]
public async Task Probe_CatalogCodeToTypeId_V1AndV2_ReadOnly()
{
Skip.If(V2EnvHelper.GetEnv(_env, "CERTINEXT_SYNC_PRODUCTID_PROBE") != "1",
"Requires CERTINEXT_SYNC_PRODUCTID_PROBE=1.");

if (_fixture.IsConfigured)
Print("V1", await _fixture.Client.GetProductDetailsAsync(CancellationToken.None));
else
_output.WriteLine("V1 not configured; skipped.");

string apiUrl = V2EnvHelper.GetEnv(_env, "CERTINEXT_API_URL");
string clientId = V2EnvHelper.GetEnv(_env, "CERTINEXT_CLIENT_ID");
string clientSecret = V2EnvHelper.GetEnv(_env, "CERTINEXT_CLIENT_SECRET");
if (string.IsNullOrWhiteSpace(apiUrl) || string.IsNullOrWhiteSpace(clientId) || string.IsNullOrWhiteSpace(clientSecret))
{
_output.WriteLine("V2 not configured; skipped.");
return;
}
using var v2 = new CERTInextClient(new CERTInextConfig
{
ApiUrl = apiUrl, UseV2Api = true, OAuthClientId = clientId, OAuthClientSecret = clientSecret
});
Print("V2", await v2.GetProductDetailsV2Async(CancellationToken.None));
}

/// <summary>
/// Why a gateway row never gets re-saved by the sync: for each order in
/// <c>CERTINEXT_PROBE_ORDERS</c> (comma-separated), prints its <c>/reports/orders</c> row (or that the report
/// doesn't list it), the plugin's mapping of that row, and Track Order's status. Read-only.
/// </summary>
[SkippableFact]
public async Task Probe_OrderReportAndTrackStatus_ReadOnly()
{
string ids = V2EnvHelper.GetEnv(_env, "CERTINEXT_PROBE_ORDERS");
Skip.If(V2EnvHelper.GetEnv(_env, "CERTINEXT_SYNC_PRODUCTID_PROBE") != "1" || string.IsNullOrWhiteSpace(ids),
"Requires CERTINEXT_SYNC_PRODUCTID_PROBE=1 and CERTINEXT_PROBE_ORDERS.");
var wanted = new HashSet<string>(ids.Split(',', System.StringSplitOptions.RemoveEmptyEntries | System.StringSplitOptions.TrimEntries));

using var v2 = new CERTInextClient(new CERTInextConfig
{
ApiUrl = V2EnvHelper.GetEnv(_env, "CERTINEXT_API_URL"), UseV2Api = true,
OAuthClientId = V2EnvHelper.GetEnv(_env, "CERTINEXT_CLIENT_ID"),
OAuthClientSecret = V2EnvHelper.GetEnv(_env, "CERTINEXT_CLIENT_SECRET")
});

var rows = new Dictionary<string, API.V2.OrderReportEntryV2>();
int total = 0;
await foreach (var row in v2.ListOrdersV2Async())
{
total++;
if (wanted.Contains(row.OrderNumber)) rows[row.OrderNumber] = row;
}
_output.WriteLine($"Report rows read: {total}");

foreach (string id in wanted.OrderBy(x => x))
{
string report = "not listed by /reports/orders";
if (rows.TryGetValue(id, out var r))
{
int? mapped = CERTInextCAPlugin.MapV2ReportStatusToDisposition(r.OrderStatus, r.CertificateStatus);
report = $"'{r.OrderStatus} | {r.CertificateStatus}' product={r.ProductCode} orderDate={r.OrderDate} " +
$"mapped={(mapped?.ToString() ?? "null (Track fallback)")}";
}
string track;
try
{
var (family, st) = await v2.ResolveAndTrackOrderV2WithFamilyAsync(id);
track = $"family={family}, status={st.Status}, orderState={st.OrderState}, certificateState={st.CertificateState}";
}
catch (System.Exception ex)
{
track = $"{ex.GetType().Name}: {ex.Message}";
}
_output.WriteLine($"{id}: report {report} -> Track: {track}");
}
}
}
}
Loading
Loading