Implement `MemberwiseClone` in some derived NodeState base classes and use `IClonable` to create a clone to preserve the class information.
Note: a deep copy requires a call to initialize after clone.
- the latest modelcompiler supports Nodeset2 which may not include the definitions for XmlencodingId or JsonEncodeingId, based on the design file.
-Catch NotSupportedException in the encodeableFactory to ignore a unsupported XmlEncodeingId.
-use IJSONEncodeable to create JSON encoding Id, if supported. Otherwise use reflection to create the id.
- Support `IClonable` in `Utils.Clone` for code which is not aware.
- Missing await on async call to write cert to rejected store. Found with analyzer `Microsoft.VisualStudio.Threading.Analyzers`
- Simplify the write by not deleting certificate with the same thumbprint, just override.
- Accidently writing a private key is not possible anymore, the cert stores are now flagged with noprivatekey support. Remove special handling.
on a decoding error of an ExtensionObject (custom complex type), the binary decoder resets the read pointer in the stream and decodes the object as ByteArray assuming the underlying complex type interpretation is invalid.
With this method decoding of large chunks can still succeed, see #1705.
The root cause for this issue is currently that client and server may have IOP issues on how structured complex types are encoded. Such warnings must be investigated and fixed.
.NET7 introduces a X509AuthorityKeyIdentifierExtension datatype which causes some ambigous datatype build errors.
Tested on .NET7 rc2
Note: Targetframework as .NET7 has not been added yet. Fix just the build if somebody tries.
-Modelcompiler Update 1.04.11 generated files.
-Update of UANodeset.xsd with 1.05.02 version.
-Add generated templates for ISessionClientMethods
Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
-Add Session.CloseAsync methods.
-Add missing Close signatures to ISession
-Mark the CloseSession service call as obsolete to prevent invalid usage
-fix UANodeSetHelper.Save(stream), to not close the stream
-fix a deadlock in the ref server app, due to the new default behavior of the cert validator not caching the approved certificates
Expose an 'ISession' interface as abstraction to ease unit testing.
Breaking changes are kept to minimal impact, but some changes maybe required to use ISession objects instead of Session.
Note: ISessionClientMethods is hand created, not yet by ModelCompiler
Currently, the validated certificates are stored in a dictionary for fast compare of the certificate validation when an application reconnects, until manually cleared by e.g. `ResetValidatedCertificates()`. After discussion it was decided to make this function an opt-in feature to avoid use cases where changes in the trusted store or CRL are not reflected in the list of validated certificates.
The runtime penalty of a full check can be avoided if needed with the 'Opt-In' by configuration or by application setting the property. After opt-in it is the application responsibility to clear the list of validated certificates if needed.
+++ Other cert validator improvements/fixes
- Setting the `ValidationOptions.SuppressRevocationStatusUnknown` on a trustlist (e.g. issuer) was ignored
- If another client/server connects with a chain, the whole chain is saved to the rejected store, not only the leaf certificate.
Improvements for complex types.
- Support to encode/decode complex type structures with multidimensional arrays.
- Perf improvements for type loader using new NodeCache fetch multiple interfaces.
- DataTypeDictionary validation when dependencies are used.
- interface for complex type resolver, to build custom types in code.
- improvements of console client to demonstrate browse/read of custom values
+++ Breaking changes +++
IDecoder interface change of the `ReadArray` method
- Return type is now `Array` for all types of arrays. Previously the method returned an array for 1-dim and a `Matrix` type for multidimensional arrays. In addition the convention in generated code is to use `Collection` for all 1-dim arrays, and so was built the `BaseComplexType`. The new convention is to expose the native `Array` type from a complex type, in all cases, hence the return type of `ReadArray` was changed to reflect that for a consistent programming model.
- `ReadArray` has a new parameter `systemType` to efficiently read encodeable types. Previously the `Type` of an encodeable was determined by the encodingid and lookup in the type factory, even when the Type is already known by the caller. The 'old' style is still supported.
- `ReadArray` supports to read encodeable type arrays which are directly encoded in structures. These arrays differ from standard encoding of arrays and they are handled when `BuiltInType.Null` is used as parameter.
* change the Certificate domain validation to work also for the server case
* do not refuse a connection if the check fails, only trigger the audit event
* bump up test Nuget
-Issue: A server might return a much smaller send and receive buffer size than what was proposed in the hello message by a client. Given the current default max chunk count, which is based on the default buffer size, the response message size is also limited by the calculated max chunk count.
- fix: Calculate the default max chunk counts based on the TCP client min buffer size.
-Make the https callbacks fully async / code cleanup.
-Default https client to use MaxConnectionsToServer = 64 for #1550
-Fix https missing reconnect error code
other fixes unrelated to https:
- move trust list audit event to AuditEvents.cs, fix issue that the event is not filtered since reportAuditEvent cannot be used
- fix an issue when BrowseNext for multiple continuation tokens doesn't add the results array properly
- bump up .NET Core 3.1 Nuget dependencies
- improve .NET reference client app for use with https
*The EncodableFactory does not index the JSON DataTypeEncodingIds because they are not defined on the types.
As a result, a JSON document that complies with the specification (see https://reference.opcfoundation.org/Core/Part6/5.4.2/#5.4.2.16) cannot be parsed.
* This change creates the JSON encoding types ids from generated code using reflection, so the JSON documents which comply with the spec can be decoded.
* Fixes type id on a JSON encoded ExtensionObject that contains binary or xml encoded data.
Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
- Move the auditing flag to server internal
- Hook up new configuration setting to the Auditing node
- A Security Admin can change the Audit setting.
- Refactor audit events to be extensions in one class.
- enable auditing and diagnostics by default for higher test coverage.
- refactor dependency of some events to bindings, e.g. TcpServerChannel should not be used as reportevent parameter
- Add methods to support to Read/Browse multiple nodes in session and NodeCache.
- Add methods to find references of multiple nodes in NodeCache.
- By default the client fetches the operation limits from the server.
- Add operation limit object to client config, settings are overwritten by server limits if server limits are smaller.
- Split client service calls if operation limits are exceeded with an override of the SessionClient. All sync/async service calls are implemented, but not the servcie calls using the Begin/End pattern.
* Add new methods for reading a set of nodes
* ReadNodes(NodeIdCollection, out DataValueCollection, out IList<ServiceResult>, bool optionalAttributes)
* (DataValueCollection, IList<ServiceResult>) ReadNodesAsync (NodeIdCollection, bool optionalAttributes)
to reduce the amount of attributes read from a server ReadNodes first reads only the NodeClass, then reads only the mandatory attributes per nodeclass to reduce the overall number of attributes to read.
If the NodeClass of all nodes is already known, the read can be further optimized to read only the attributes for a known class:
* ReadNodes(NodeIdCollection, NodeClass, out DataValueCollection, out IList<ServiceResult>, bool optionalAttributes)
* (DataValueCollection, IList<ServiceResult>) ReadNodesAsync (NodeIdCollection, NodeClass, bool optionalAttributes)
to complete async and collection operation, there is a:
* ReadNodeAsync and
* ReadValues/ReadValuesAsync
* An issue was fixed in the https async codepath, the security header was not properly set in async operation
sidenote: operation limits must be handled by caller!
Co-authored-by: Martin Regen <mregen@microsoft.com>
* Handle JWT and set the IssuedTokenType in the server based on the policy referenced by the PolicyId in the client supplied UserIdentityToken .
* Connect/Reconnect tests cases with JWT
-Added a loader if no PFX private key exists, the PEM private key is loaded.
-Added the support in certificate validator for custom application error messages.
The sample included a fully named NodeId but the Format() uses the information already included in the instance. It might be easier to understand, if there is another sample and a node. Thus we can avoid confusion.
- Chunk count one compare is incorrect
- Instead of a static configuration calculate the chunk count limits dynamically, as changing buffer size in the negotiation was not taken into account and could lead to reduced message size.
- Remove the static chunk count calculation.
- set `KeepAliveTimeout` default back to 5s, was unintentionally set to 50s in 368 release
- fix a bug that duplicate subscriptions were created after reconnect when transfer succeeds.
- add a property to enable subscription transfer in reconnect, set `Session.TransferSubscriptionsOnReconnect=true` to enable, IOP issues may not allow to use it with some servers.
- add a `SessionReconnectHandler(true)` constructor to support reconnect abort, if the connection recovers before reconnect timer called. If the new constructor is used, its a breaking change: Needs check of `Session` property in Reconnect handler callback, if aborted `Session==null`.
- Reduce warning log output if server timestamp > client time.
- Add handling when subscriptions can not be transferred, e.g. when false user credentials or no security prevent transfer.
- Improve the reconnect timer handling by using `OperationLimit` in reconnect.
- Add sample for `SessionReconnectHandler` in console client.
- Seperate session sample code from `UAClient`.
- Tested on popular demo servers of various SDK vendors.
- Fix Winforms ref client
* Added default values DefaultRequestMaxChunkCount and DefaultResponseMaxChunkCount
* The negotiated Request and Response MaxChunkCount values are checked when building a chunked message.
- Certificates should compare X500DistinguishedName with binary ASN.1 compare
- Other compares should follow ordinal and not resort DN entries
- Fix all related issues to pass tests, e.g. GDS certificates accepted with reversed Subject, cert validation
- Add defensive checks in cert validation
Co-authored-by: mrsuciu <Mircea-Adrian.Suciu@softing.com>
Add the getter (since the System.Net.Sockets.Socket: m_socket does not implement a setter) for the LocalEndPoint so that a user can access the Information on which IP+Port the Socket is running on
- Improve formatting and log strings for new alarm node managers.
- Remove the TestData Alarms as they cause issues in the CTT tests
- Add a -ctt option to start the alarms endless for testing, stop alarms in other node managers.
- Unify the way the node managers are created in the quickstarts sample.
- Bring back 'dummy' appveyor config to disable the builds.
- fix codecov build
- add a few more unrelated tests
- Add missing PEM private key export for EC (.NET6/Netstandard2.1 only)
- Remove some duplicate code in PEMWriter class
- Refactor enumerator for Test Datapoint sources to be generic and usable for more cases
- Add some tests for NodeSet2 import (using the refactored enumerator)
- Fix some warnings and PR template typos along the way.
Headers incorrectly state that the RCL applies to members, however the OPC Source Deliverables license states RCL is applicable only to corporate members.
The OPC Foundation Technical Control Board on March 30th decided on the following changes with regard of the license headers:
• Change the dual license in the source files so that “members” are replaced with “corporate members”.
Co-authored-by: Suciu Mircea Adrian <Mircea-Adrian.Suciu@softing.com>