Repository navigation
Notify certificate manager after GDS certificate revocation - #5070
Conversation
RevokeCertificate and UnregisterApplication wrote the CRL to the stores but never raised CrlUpdated, so the trust material enforcement pump did not revalidate already open channels and sessions using the revoked certificate.
There was a problem hiding this comment.
🟡 Changes recommended
Revocation notifications can leave revoked certificates accepted when HTTPS or user validation uses separate stores because the updated CRL is not persisted to those stores.
1 open issue
What changed in this PR
This PR connects GDS certificate revocation to the certificate manager’s existing trust-material enforcement so persisted revocations trigger revalidation.
Changes:
- Notifies the peer trust list and applicable HTTPS or user scope after successful revocation, including during application unregistration.
- Logs notification failures without undoing persisted revocations.
- Extends the client regression test to verify peer-CRL notifications; end-to-end session closure remains unverified.
| File | Description |
|---|---|
| tests/Opc.Ua.Gds.Tests/ClientTest.cs | Verifies peer-CRL notifications after successful revocations. |
| src/Opc.Ua.Gds.Server/ApplicationsNodeManager.cs | Adds scope-aware revocation notifications and failure logging. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
ClientTest covers only Default-group peer notifications, leaving HTTPS and user-token scope notifications—including the Users notification that triggers active X.509 session revalidation—without regression coverage.
1 open issue
1 resolved since last review
Review effort: Balanced
Code coverage✅ Coverage gate passed.
Uncovered changed lines
Coverage is above the recorded baseline - consider ratcheting Thresholds live in |
There was a problem hiding this comment.
🟡 Changes recommended
Critical revocation-handling defects can suppress peer revalidation after partial updates, bypass configured store providers, and leave historical issuers’ CRLs stale in HTTPS/user stores.
3 open issues
1 resolved since last review
Review effort: Balanced
romanett
left a comment
There was a problem hiding this comment.
Please add an integration test where a client revokes its own certificate to ensure the session is closed (if this is blocked by gds, use a second client / session)
|
No threshold change is needed for this report: it confirms the coverage gate passed and labels ratcheting as advisory. I left the global coverage threshold unchanged; the focused regressions added for this review cover the scoped-store and notification behavior. |
|
Review note: this can be much smaller. To end sessions whose client certificate was revoked, the only missing piece is the Suggestions
Tests: the current tests check that the notification and the store copies happen, but none shows that an open session is actually closed after With items 1–5, the product change would be about 40 lines instead of about 240. |
Per review: drop the scoped HTTPS/Users store CRL sync, notify the certificate manager once for the Peers scope when the CRL is updated and log notification failures. Keep passing the certificate type to GetGroupForCertificate so the group is selected by the type the certificate was issued for. Add an end-to-end test that opens a self-admin session with a GDS issued certificate, revokes the certificate through the GDS and asserts that the session can no longer be used.
|
@romanett thanks, all applied in 40c00ec. The product change is now +28/−4 lines in
End-to-end test (also for your review 5875202650):
Note: for a revoked application (peer) certificate, the trust-material handler closes the SecureChannel, not the session object. Only With the notification call disabled, the test fails after its 30 s deadline. With the call in place, it passes in about 1 s. The GDS |
…ificate-revocation-fix
GitHub-hosted runner images now preinstall the .NET 11 SDK. global.json pins 10.0.403 with rollForward latestMajor, so setup-dotnet resolved the preinstalled SDK 11 and its new analyzers (CA2027 and others) failed the build-UA and test jobs. The new setup-repository-dotnet composite action installs the exact global.json SDK, plus any extra SDKs a job needs, into a job-private directory under RUNNER_TEMP, and fails the job unless dotnet resolves that exact SDK from that directory. Every workflow except release.yml uses it; the release job checks out a candidate commit that can predate the action and only pushes packages that were already built. Jobs that build the Aspire AppHost install the Aspire CLI bundle first, so the AppHost build does not run 'aspire setup' itself under a two-minute timeout, which intermittently failed with ASPIRE009.
The WoT registry reconcile queue writes registry node references while a lifecycle publication is being prepared. The server then rejects the reservation with "Serving references changed during preparation." before the durable decision starts, so nothing was published. Activation units already retried this conflict, but unload and retire-only publications (an empty activation plan) called RefreshPreparedUnitAsync directly and surfaced the conflict to the caller. This made ProgrammaticUnloadAppliesPolicyWithoutReactivatingItsResolutionInput fail intermittently in CI. Both paths now share one helper that rebuilds the unit from live serving state within the existing three-attempt budget, with a short backoff so the concurrent writer can finish. Conflicts after the decision and unrelated failures are still propagated without a retry.
FailoverAsyncSwitchesToExplicitTargetAsync failed intermittently in CI with "Expected: Failover But was: Connected". ConnectionStateMachine releases the ConnectAsync waiters before it dispatches the Connecting -> Connected notification, so a handler subscribed right after ConnectAsync returns can still receive that initial transition. Injecting a delay before the dispatch reproduced the failure in this test and in two reverse-connect redundancy tests that subscribe the same way. The tests now record only transitions that do not start in Connecting, via a shared RecordStatesAfterConnect helper. All 25 redundancy tests pass with and without the injected delay.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5070 +/- ##
==========================================
- Coverage 83.59% 83.59% -0.01%
==========================================
Files 3780 3780
Lines 553499 553512 +13
Branches 94437 94437
==========================================
- Hits 462723 462691 -32
- Misses 59563 59599 +36
- Partials 31213 31222 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Resolve conflicts with the net11.0/SDK 11 move (#5072): keep the setup-repository-dotnet action in every workflow and pass master's extra 10.0.x runtime installs through its dotnet-version input. Install the Aspire bundle for net11.0 legs as well, since the AppHost imports the Aspire SDK for net11.0, and describe the latestFeature roll-forward policy in the SDK selector and action.


Description
When the GDS revokes a certificate, it now notifies the server's certificate manager. Before this change,
RevokeCertificatewrote the new CRL to the issuer store but raised noCrlUpdatedevent. As a result, a SecureChannel already open with the revoked certificate stayed usable. In the report, anApplicationSelfAdminsession could still callUpdateApplicationafter its certificate was revoked, while new connections already failed withBadSecurityChecksFailed.After the CRL is written, the shared revocation path calls
NotifyTrustListChanged(TrustListIdentifier.Peers, trustChanged: false, crlChanged: true)once. The server's trust-material enforcement then revalidates the open SecureChannels and closes the one that uses the revoked certificate, so the session can no longer be used. The path covers bothRevokeCertificateand the revocations done duringUnregisterApplication. If the notification fails, the failure is logged and the persisted revocation is kept.GetGroupForCertificatenow takes the certificate type that the caller already knows from the application record, instead of inferring the type from the certificate. This selects the certificate group by the type the certificate was registered for.Following review, this PR does not sync the CRL into the scoped HTTPS or user-token issuer stores. That can be handled in a separate PR.
New end-to-end test
RevokeCertificateSessionTest:GetApplication.The existing
ClientTest.RevokeGoodCertificatesAsyncalso verifies thePeersCrlUpdatednotification. No public API or configuration changes are introduced.CI fixes included in this PR
The PR also fixes CI failures that do not come from the GDS change, so the checks can pass:
global.json, and theglobal.jsonroll-forward policy lets the dotnet host select them. When this PR started,global.jsonpinned 10.0.403 withrollForward: latestMajor, sosetup-dotnetpicked the preinstalled SDK 11, and its new analyzers failed the build. Master has since moved to 11.0.100 withrollForward: latestFeature(Add net11.0 target, run PR CI on net11.0, fix .NET 11 SDK analyzer findings #5072), which still lets a newer preinstalled 11.0 feature band win. The new composite action.github/actions/setup-repository-dotnetinstalls the exactglobal.jsonSDK, plus any extra SDKs a job needs (such as the10.0.xruntime for net10.0 jobs), into a job-private directory underRUNNER_TEMP. The job fails unlessdotnetresolves that exact SDK. Every workflow exceptrelease.ymluses the action.release.ymlis unchanged because it checks out a candidate commit that can predate the action, and it only pushes packages that were already built..github/scripts/install-aspire-bundle.ps1). Before, the AppHost build ranaspire setupitself under a two-minute timeout and intermittently failed with ASPIRE009. The bundle is installed for net10.0 and net11.0 legs, because the AppHost imports the Aspire SDK for both.ProgrammaticUnloadAppliesPolicyWithoutReactivatingItsResolutionInput(Force)failed intermittently with "Serving references changed during preparation." The registry reconcile queue writes registry node references while a lifecycle publication is being prepared, so the server rejects the reservation before the durable decision. Activation units already retried this conflict. Unload and retire-only publications, which have an empty activation plan, did not. Both paths inWotMaterializationCoordinatornow share one retry helper with the existing three-attempt budget and a short backoff. Conflicts after the decision and unrelated failures are still not retried. The new testUnloadPublicationRetriesPredecisionReferenceConflictsWithinThePublicationBudgetinjects the conflict at the unload commit. It failed for 1 and 2 conflicts before the fix and passes after it.FailoverAsyncSwitchesToExplicitTargetAsync(True)failed intermittently with "Expected: Failover But was: Connected".ConnectionStateMachinereleases theConnectAsyncwaiters before it dispatches theConnecting→Connectednotification. A handler subscribed right afterConnectAsyncreturns can therefore still receive that initial transition. This test and two reverse-connect redundancy tests that subscribe the same way now ignore transitions that start inConnecting, through a sharedRecordStatesAfterConnecthelper. A 1 s delay injected before the dispatch made all three tests fail. With the change, they pass with and without the delay.origin/master, including the net11.0 target and SDK 11 move (Add net11.0 target, run PR CI on net11.0, fix .NET 11 SDK analyzer findings #5072), was merged into the branch. The workflow conflicts were resolved by keeping the shared action and passing master's extra10.0.xinstalls through itsdotnet-versioninput.Follow-ups, not part of this PR:
WotRegistryNodeManager.SafeReconcileAsynclogs and drops reconcile failures. A partially created version node can then stay attached without its registry entry..azurepipelines/onefuzz.ymlstill usesUseDotNet@2withuseGlobalJson.ConnectionStateMachinesignals that a connect, failover or reconnect has settled before it dispatches the matchingConnectionStateChangednotification. A subscriber attached after the awaited call returns can receive a stale transition. Changing that order also affects settled resets from concurrent requests, so it needs a separate change.Validation
TEMPandTMPwere set toD:\temp.dotnet test tests\Opc.Ua.Gds.Tests\Opc.Ua.Gds.Tests.csproj -f net10.0 --filter "FullyQualifiedName~RevokeCertificateSessionTest|FullyQualifiedName~Opc.Ua.Gds.Tests.ClientTest|FullyQualifiedName~CustomCertificateGroupIntegrationTest"-f net48dotnet test tests\Opc.Ua.Tools.Tests\Opc.Ua.Tools.Tests.csproj -f net10.0 -p:CustomTestTarget=net10.0 --filter "FullyQualifiedName~TestMatrixScriptTests|FullyQualifiedName~CiPathRelevanceTests"dotnet test tests\Opc.Ua.WotCon.Tests\Opc.Ua.WotCon.Tests.csproj -f net10.0 -p:CustomTestTarget=net10.0 --filter "FullyQualifiedName~WotAtomicPublicationNativeTests"UnloadPublicationRetries, with the unload path temporarily reverteddotnet test tests\Opc.Ua.Client.Tests\Opc.Ua.Client.Tests.csproj -f net10.0 -p:CustomTestTarget=net10.0 --filter "FullyQualifiedName~ManagedSessionServerRedundancyTests"with a temporary 1 s delay before theConnecting→Connecteddispatch, before the test changeFailoverAsyncSwitchesToExplicitTargetAsync(both cases),ReverseConnectServiceLevelDropFailsOverOverMemberConnectionAsyncandReverseConnectMemberWithoutConnectionIsNeverSelectedAsyncfailed with the CI symptom (red check).dotnet test tests\Opc.Ua.Tools.Tests\Opc.Ua.Tools.Tests.csproj -f net10.0 -p:CustomTestTarget=net10.0 --filter "FullyQualifiedName~TestMatrixScriptTests"dotnet buildofOpc.Ua.Gds.Tests,Opc.Ua.WotCon.TestsandOpc.Ua.Client.Testswith-f net11.0 -p:CustomTestTarget=net11.0dotnet test tests\Opc.Ua.Gds.Tests\Opc.Ua.Gds.Tests.csproj -f net11.0 -p:CustomTestTarget=net11.0 --filter "FullyQualifiedName~RevokeCertificateSessionTest"dotnet test tests\Opc.Ua.Gds.Tests\Opc.Ua.Gds.Tests.csproj -f net10.0 --filter "FullyQualifiedName~RevokeCertificateSessionTest" -p:TreatWarningsAsErrors=false -p:RunAnalyzers=falsewith theNotifyTrustListChangedcall temporarily disabled.RevokeCertificateSessionTestfailed after its 30 s deadline with "The session using the revoked certificate can still be used." With the call restored, the test passes in about 1 s. Coverage delta was not measured.The full
UA.slnxsuite was not run locally. Earlier local net48 solution runs were blocked by environment-specific path failures in unrelated fixtures (AMB, SourceGeneration, OpenUsd). CI covers the full suite.Related Issues
Checklist
Put an
xin the boxes that apply. You can complete these step by step after opening the PR.