Files
Copilot d8aca69444 Remove unused MinMetadataSamplingInterval configuration option (#4194)
## Description

Server-side `MonitoredItem` sampling interval revision is based on the
per-node `BaseVariableState.MinimumSamplingInterval` attribute, not on
any global server setting —
`ServerConfiguration.MinMetadataSamplingInterval` was dead configuration
that was never read by any code path. Per maintainer feedback, this PR
removes it instead of wiring it into revision logic that was never meant
to consume it.

Separately, the concern that `Subscription.MaxNotificationsPerPublish`
isn't revised by the server was verified against existing coverage:
`CreateSubscriptionWithNotificationLimitsUsesEffectiveLimitAsync` /
`ModifySubscriptionWithNotificationLimitsUsesEffectiveLimitAsync` in
`SubscriptionTests.cs` already assert the server clamps a
client-requested value down to the configured server limit (e.g.
requested `25` vs. server limit `10` → revised `10`).

### Removed `MinMetadataSamplingInterval`
- Dropped the `ServerConfiguration.MinMetadataSamplingInterval` property
(`ApplicationConfiguration.cs`) and its XSD element
- Dropped `SetMinMetadataSamplingInterval` from
`IApplicationConfigurationBuilder` / `ApplicationConfigurationBuilder`
- Removed the element from sample and test server configuration XML
files (`Ctt.ReferenceServer.Config.xml`,
`Quickstarts.ReferenceServer.Config.xml`, GDS test configs,
`test-server-full.xml`)
- Updated `ApplicationConfigurationBuilderTests` and
`ConfigurationRoundTripTests` to drop assertions on the removed property

## Related Issues

## Checklist

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [ ] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [ ] I have added all necessary documentation.
- [ ] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #4191

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
2026-08-08 17:11:42 +02:00
..

OPC Foundation UA .NET Standard Reference Server

Introduction

The console reference server can be configured using several console parameters. Some of these parameters are explained in more detail below.

To see all available parameters call console reference server with the parameter -h.

Reverse Connect

The OPC UA reverse connect feature allows an OPC UA server to initiate the connection to a client, rather than the traditional model where clients connect to servers. This is particularly useful in scenarios where the server is behind a firewall or NAT, making it difficult for clients to directly connect to it.

How to use Reverse Connect

To enable reverse connect mode, specify the client endpoint URL using the --rc or --reverseconnect parameter:

dotnet ConsoleReferenceServer.dll --rc=opc.tcp://localhost:65300

or

dotnet ConsoleReferenceServer.dll --reverseconnect=opc.tcp://localhost:65300

Example: Server and Client with Reverse Connect

  1. Start the client with reverse connect listener on port 65300:

    dotnet ConsoleReferenceClient.dll --rc=opc.tcp://localhost:65300 opc.tcp://localhost:62541/Quickstarts/ReferenceServer
    
  2. In a separate terminal, start the server with reverse connect to the client:

    dotnet ConsoleReferenceServer.dll --rc=opc.tcp://localhost:65300 -a
    

The server will establish a reverse connection to the client endpoint, and the client will use this connection to communicate with the server.

Additional Options

  • -a or --autoaccept: Auto accept untrusted certificates (for testing only)
  • -c or --console: Log to console
  • -l or --log: Log app output
  • -t or --timeout: Timeout in seconds to exit application

For the complete list of options, use --help.

X509 user identity certificates

The reference server validates X509 user identity tokens against its trusted-user certificate store (TrustedUserCertificates, by default %LocalApplicationData%/OPC Foundation/pki/trustedUser). An untrusted user certificate is rejected with BadIdentityTokenRejected — the --autoaccept option only auto-accepts the application/channel certificate, never user identity certificates.

To let a trusted client (for example the OPC Foundation Compliance Test Tool) authenticate with an X509 user token, its user certificate must be present in that store. To make provisioning easy, the server writes every rejected X509 user certificate to a dedicated review store, pki/rejectedUser (a sibling of pki/trustedUser). After one failing activation you can move the legitimate user certificate from pki/rejectedUser/certs into pki/trustedUser/certs (and any issuing CA into pki/issuerUser/certs) and reconnect. Deliberately-untrusted certificates simply stay out of the trusted store and continue to be rejected.