Conversation
Bump the OPC UA .NET Standard preview pin from 2.0.312.3680-preview to 2.0.334.14261-preview, the newest package set published from the SDK's master branch. ComplexTypeSystem is now IDisposable, so the three type system loaders dispose it; disposing only releases the resolver it owns, the loaded types stay registered on the session. The last use of the obsolete Variant.Value goes to AsBoxedObject(). SDK #4477 made Thumbprint and X509Subject identity criteria match the user certificate of an X509IdentityToken, as Part 18 specifies, instead of the client application certificate. The RoleManagement workstation relied on the old reading, so it now signs in with its own application certificate as an X509 user token: the server offers a Certificate user token policy, user certificate trust stores and the stack's X509Authenticator; the client offers a "Workstation certificate" sign in built by the new SampleIdentities helper; the tests connect the same way and also prove an anonymous Session with the workstation certificate on its channel earns nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Proposed changes
Bumps the OPC UA .NET Standard preview pin in
targets.propsfrom2.0.312.3680-previewto2.0.334.14261-preview. That is the newest package set published bynuget-publish.ymlon the SDK's master branch (SDK commit37b5522).SDK API follow-ups
ComplexTypeSystemis nowIDisposable(new CA2000 warnings). The three type-system loaders (SampleConnection,SessionOpenDlg,DataTypesClientModel) now dispose it withusing.Disposeonly releases the resolver the type system owns, and the types it loaded stay registered with the session.Variant.Value(AuditEventStream) now usesAsBoxedObject().RoleManagement: certificate role rules now match the user certificate
SDK #4477 (
fa8d45f2c) changedRoleManager.ResolveGrantedRolesso thatThumbprint/X509Subjectidentity criteria match the certificate in an X509 user token, and only when the token type is Certificate. Part 18 specifies this. The rules used to match the client application certificate. The sample's maintenance workstation relied on the old behavior: an anonymous encrypted session held ConfigureAdmin. So three tests passed on 2.0.312 and failed on 2.0.334. I confirmed this by running them against both versions.The workstation now signs in with its own application certificate as an X509 user token:
Certificate_2user-token policy with its ownSecurityPolicyUri, so it also works on the unsecured endpoint.TrustedUserCertificates/UserIssuerCertificatesstores.X509Authenticator, registered inRoleManagementServerHosting.SampleIdentities.FromApplicationCertificateAsyncbuilds the identity (UserIdentity.CreateAsyncvia the configuration's certificate provider). It runs off the UI thread because the token handler loads the private key synchronously.TestClient.ConnectWithCertificateAsyncnow signs in with the certificate. It has asignIn: falseoption for the negative case: an anonymous session with the workstation certificate on its channel gets nothing. The Thumbprint test and the WinForms tier-2 test sign in the same way.Client.CommonREADME explain the new behavior.Related Issues
Types of changes
Checklist
Further comments
Local results: SampleConfiguration 247, SampleClientModels 448 (+3 skipped), SampleNodeManagers 205 (+1 skipped), SampleServers 126, SampleClients 65. No failures. I compared a full
--no-incrementalbuild's warnings before and after the bump: the CA2000s fixed above were the only new ones.Manual step when running the sample by hand: the server must trust the client certificate as a user certificate. Copy it from the client's
pki\own\certsintopki\trustedUser, or the server refuses the workstation sign-in withBadIdentityTokenRejected. The tests don't need this because the test PKI auto-accepts certificates, and that also applies to the user trust list.An alternative was to keep matching the channel certificate with a custom role resolver. I dropped it because the old behavior contradicts Part 18, and a Quickstart should show the conformant path.
🤖 Generated with Claude Code