Skip to content

Explicit ApplicationUri validation on Startup after certificates are loaded & on Client Side CreateSession#3244

Merged
marcschier merged 12 commits intoOPCFoundation:masterfrom
mrsuciu:Issue3233
Oct 31, 2025
Merged

Explicit ApplicationUri validation on Startup after certificates are loaded & on Client Side CreateSession#3244
marcschier merged 12 commits intoOPCFoundation:masterfrom
mrsuciu:Issue3233

Conversation

@mrsuciu
Copy link
Contributor

@mrsuciu mrsuciu commented Oct 8, 2025

Added RejectCertificateUriMismatch property and explicit ApplicationUri validation after certificates are loaded

Proposed changes

Describe the changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Related Issues

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@mrsuciu mrsuciu marked this pull request as draft October 8, 2025 13:29
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 56.09756% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.10%. Comparing base (fab6f2a) to head (7c6ad50).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...Core/Security/Certificates/CertificateValidator.cs 9.67% 23 Missing and 5 partials ⚠️
...ack/Opc.Ua.Core/Schema/ApplicationConfiguration.cs 40.90% 9 Missing and 4 partials ⚠️
...ack/Opc.Ua.Core/Security/Certificates/X509Utils.cs 73.33% 2 Missing and 2 partials ⚠️
...raries/Opc.Ua.Configuration/ApplicationInstance.cs 81.25% 1 Missing and 2 partials ⚠️
Stack/Opc.Ua.Core/Stack/Server/ServerBase.cs 0.00% 2 Missing ⚠️
Libraries/Opc.Ua.Client/ReverseConnectManager.cs 0.00% 1 Missing ⚠️
...ies/Opc.Ua.Gds.Client.Common/CertificateWrapper.cs 0.00% 1 Missing ⚠️
Libraries/Opc.Ua.Server/Server/StandardServer.cs 92.30% 0 Missing and 1 partial ⚠️
...ore/Security/Certificates/CertificateIdentifier.cs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3244      +/-   ##
==========================================
+ Coverage   57.85%   59.10%   +1.24%     
==========================================
  Files         368      319      -49     
  Lines       80144    76123    -4021     
  Branches    13907    13271     -636     
==========================================
- Hits        46367    44992    -1375     
+ Misses      29562    27072    -2490     
+ Partials     4215     4059     -156     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrsuciu mrsuciu marked this pull request as ready for review October 30, 2025 15:23
@mrsuciu mrsuciu requested a review from romanett October 30, 2025 15:23
@romanett
Copy link
Contributor

@mrsuciu Your new test seems to be flaky on Mac:
CreateSessionApplicationUriValidationTests

@marcschier marcschier merged commit 1f47847 into OPCFoundation:master Oct 31, 2025
98 of 101 checks passed
@romanett romanett linked an issue Nov 12, 2025 that may be closed by this pull request
5 tasks
@romanett romanett changed the title Added RejectCertificateUriMismatch property and explicit ApplicationUri validation after certificates are loaded Explicit ApplicationUri validation on Startup after certificates are loaded & on Client Side CreateSession Nov 19, 2025
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.

ApplicationUri get replaced when mismatch from the certificate OPCUA client should check the application URI of the server certifiate

3 participants