Commit Graph

27 Commits

Author SHA1 Message Date
Martin Regen 4c0880c800 Fix codesmells. No functional changes and bug fixes. (#2368)
Fix many warnings to improve code quality or simplify the code.
2023-11-07 10:34:42 +01:00
Martin Regen d47bc853da Various async improvements and minor issues found in IOP testing (#2346)
- improve various log messages, comments etc.
- multiple internal improvements in naming convention handling of async functions
- add FetchSuperTypesAsync
- replace new UTFEncoding() with Encoding.UTF8 singleton
2023-10-20 21:29:03 +02:00
dependabot[bot] 5f82d1b3d3 Bump Microsoft.Extensions.Logging.Abstractions from 3.1.32 to 7.0.1 (#2233)
* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.32 to 7.0.1

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/dotnet/runtime) from 3.1.32 to 7.0.1.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/commits/v7.0.1)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Logging.Abstractions
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Opc.Ua.Core.csproj

* Update UA Server Controls.csproj

* Update UA Client Controls.csproj

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-14 08:34:11 +02:00
Martin Regen e6f3004d6e Improve client subscription implementation (#2245)
- shutdown the worker tasks with a ManualResetEvent instead of timer null check
- Breaking change: Decorate the PublishStateChanged event handler with state information:
- - Stopped/Recovered if publish times out/restarts
- Breaking change: PublishStateChange fired for every received publish response, which doesn`t really indicate a state change. 
-- new behavior: fires only if a Keep alive or republish is triggered.
2023-08-04 10:17:38 +02:00
Suciu Mircea Adrian eaa3cb0af5 Bring back Microsoft.Extensions.Logging.Abstractions to V3.1.32 for older target frameworks (#2229) 2023-07-20 10:47:49 +03:00
dependabot[bot] 5a08618af0 Bump Microsoft.Extensions.Logging.Abstractions from 3.1.32 to 7.0.1 (#2194)
* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.32 to 7.0.1

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/dotnet/runtime) from 3.1.32 to 7.0.1.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/commits/v7.0.1)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Logging.Abstractions
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Opc.Ua.Core.csproj

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Regen <mregen@microsoft.com>
2023-07-19 10:33:07 +03:00
Martin Regen c7bd19dc46 Support use of opc.https endpoint url for client and server. (#2140)
Currently the https protocol doesn't support a spec compliant endpoint with a `opc.https` prefix., as client and server.
Fix:
- Add the client and server support for the `opc.https` prefix. 
- Continue support for `https` prefix for non compliant implementations.
- Any CancellationTokenSource should be disposed after being used.
- Follow coding guidelines
- Use macOS cert callback
2023-06-12 09:05:10 +02:00
Martin Regen 043a56c3f2 Deprecate .NET framework 4.6.2 support, sync with samples repo (#2165)
- Deprecate support for Nuget package support of .NET Framework 4.6.2
- Bump sample applications to 4.8
- update some copyright headers / supporting files (editorconfig etc.)
- fix a few warnings
- fix an issue with `SessionReconnectHandler`, in certain combination of reconnect period and exponential backoff the .NET sample app never reconnected.
2023-05-31 18:53:56 +02:00
Martin Regen abfbde3bec Improvements for docker hosting and fix for GetEndpoints (#2123)
- Add environment variables as parameter to support docker hosting where command line parameter are not available
- bump some Nuget packages
- only warn on cert validation error on startup, e.g. when the CRL becomes outdated allow to start and print warning.
- Let GetEndpoints return endpoints which match the DNS name used. DNS names must be specified as alternate hostnames in the configuration.
2023-04-18 18:09:55 +02:00
Martin Regen 7a06c9b15d Fix browse samples (#2040)
- Fix browse issues mentioned in #1989 by @logicaloud
- improve console browse sample, if `BadNoContinuationPoints` is returned, reschedule the nodes for the next round

Co-authored-by: @logicaloud
2023-01-09 20:25:02 +01:00
Martin Regen da1b1a7112 Add Session.CloseAsync, fix UANodesetHelper.Save (#1944)
-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
2022-10-11 11:03:00 +02:00
Ivan van Heerden 1f2a30d7ca Add abstraction 'ISession' for Session object in the Client library (#1702)
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
2022-10-07 20:11:53 +02:00
dependabot[bot] 95c384f454 Bump Microsoft.Extensions.Logging.Abstractions from 6.0.1 to 6.0.2 (#1932)
* Bump Microsoft.Extensions.Logging.Abstractions from 6.0.1 to 6.0.2

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/dotnet/runtime) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/compare/v6.0.1...v6.0.2)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Logging.Abstractions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Opc.Ua.Core.csproj

* Update UA Client Controls.csproj

* Update UA Server Controls.csproj

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Regen <mregen@microsoft.com>
2022-09-26 10:41:18 +03:00
Martin Regen f273634d74 Improve https transport and other bug fixes (#1908)
-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
2022-08-20 23:44:09 +02:00
Martin Regen 5a77423265 Update codeql action script to v2 (#1894)
* bump up abstraction logging 3.1.27, add references to solve some warnings
2022-08-08 05:38:24 +02:00
Martin Regen fd9a91afe7 Fix issues with reconnect handler and subscription transfer (#1802)
- 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
2022-05-11 22:28:07 +02:00
Martin Regen a147eb55c5 Tracing and Logging improvements for the UA Core and libraries (#1631)
- support for Microsoft.Extensions.Logger.ILogger in Opc.Ua.Core as the new logging interface
- backward compatible with config and TraceEvents
- new API Utils.SetLogger allows to set ILogger
- updated Console samples to demonstrate ILogger support with Serilog
- support for EventSource logging
- see Docs/Logging.md for more info
2021-12-16 00:20:08 +01:00
Martin Regen 2430a651ea Enforce Roslynator checks in CI build (#1608)
- The ci pass includes Roslynator checks, fails on warnings
- Fix all existing warnings
2021-11-24 14:44:31 +01:00
Martin Regen 53ec78f1bc IOP workshop 2021 fixes and build improvements (#1562)
-fixes for complex types:
  - a structure which contains an enum from namespace 0 can not be created. fixes #1561.
  - a structure with multidimensional array may lead to a endless loop in `ComplexTypeSystem.Load`
  - a malformed namespace Uri which contains a space character prevents creation of type system.
  - select endpoint doesn't pick the right scheme if the default endpoint must be picked
-prep for net472 or greater and net5.0 or greater build, only build #ifdef
2021-10-29 16:21:43 +02:00
Martin Regen 4a14df9cd5 Fix build and LGTM warnings (#1251)
- Fix only build and LGTM warnings
- no bug fixes - - oh wait -- found and fixed root cause for flaky builds, forgotten await when add cert to trusted folder
- remove source files from WinForms libraries which are not used in the projects
2021-01-20 20:18:36 +01:00
Martin Regen bfa117b7a7 Implement an AcceptAll flag in the cert validator callback (#1230)
- The AcceptAll flag can be used to accept all suppressible errors in one call back
- Behaviour unchanged when only Accept is set, callback is invoked for all errors and all must be approved
2021-01-07 10:16:07 +01:00
Martin Regen 4752a808df Validate server domains in Cert validator (#1226)
- Based on new handling of multiple suppressible errors, add also the domain check to the list
- Move domain check in validator and use cert validation callback to handle BadCertificateInvalidHostname.
- Allow to handle all suppressible errors including the domain check by the cert validator callback, approve all errors by new AcceptAll flag. Applications which only set Approve are called for each of the suppressible errors and must approve eah of them.
- Add approval of multiple errors to sample UI
- fix a few warnings
2021-01-07 09:26:14 +01:00
Martin Regen f904139298 Refactor CertificateFactory, remove bouncy castle dependency in Opc.Ua.Core for .NET Core 3.1 (#1209)
- remove use of Bouncy Castle for .NET Core 3
- refactor CreateCertificate class to allow for an easier Create fluent model with respect to future extensions, e.g. ECC
- reimplement X509CRL and a couple of extension relevant for OPC UA based on the new System.Formats.Asn1 library
- use CertificateRequest on .NET Core 3.1
- refactor codebase to allow for a seperate library to handle all the ASN.1 encoding/decoding
- new package Opc.Ua.Security.Certificates with all ASN.1 encode/decode related code
breaking change: many  X509 related util functions were moved to X509Utils class
Note: .NET 4.6.2 and .NET Core 2.1 versions still use BouncyCastle for Cert creation
2020-12-13 18:17:54 +01:00
AlinMoldovean 764c481405 Update Copyright year to 2020 2020-10-07 18:04:34 +03:00
Martin Regen 80a422136d Add Versioning and new nuget package structure to preview builds (#1130)
- use nerdbank.gitversioning to determine devops build version
- split nuget packages into new structure, one package per assembly to allow granular use of packages.
- also build .Debug versions
- back compat at least for a while, the old Opc.Ua packages reference also the new packages.
- devops produces preview builds for master
- preview builds are now signed, including nuget packages
- add license files for nuget packages, since licenseUrl is deprecated
2020-10-07 14:50:36 +02:00
Martin Regen cd88663b29 Policheck and move new Cert test to the right location (#1057)
- Policheck tool flagged a few words
- the new cert test went in the old location before the split, move and fix it...
- add es/de to localized text data...
- fix exception if client reverse connect is configured
2020-07-15 07:14:50 +02:00
Alin Moldovean 5faf85a7b9 Create Applications folder with ReferenceClient/Server (#1015)
* Clean UA Reference solution

* Move ReferenceClient/Server

* Copy Client/ServerControls libraries
Fix project references

* Rename docs to Docs

* Rename GDS libraries according to naming convention
2020-06-15 09:36:09 +03:00