Fix OPC UA adapter: pass connection details, certificate stores, endpoint discovery

- DataConnectionActor now stores and passes connection details to adapter ConnectAsync
- DataConnectionManagerActor passes connection details when creating actor
- RealOpcUaClient uses DiscoveryClient for endpoint selection with no-security preference
- Added certificate trust store paths to prevent TrustedIssuerCertificates error
- Sanitize connection names for Akka actor paths (replace spaces)
This commit is contained in:
Joseph Doherty
2026-03-17 12:19:44 -04:00
parent 8e1d0816b3
commit 1b06a4971e
3 changed files with 35 additions and 9 deletions

View File

@@ -44,9 +44,13 @@ public class DataConnectionManagerActor : ReceiveActor
var adapter = _factory.Create(command.ProtocolType, command.ConnectionDetails);
var props = Props.Create(() => new DataConnectionActor(
command.ConnectionName, adapter, _options));
command.ConnectionName, adapter, _options, command.ConnectionDetails));
var actorRef = Context.ActorOf(props, command.ConnectionName);
// Sanitize name for Akka actor path (replace spaces and invalid chars)
var actorName = new string(command.ConnectionName
.Select(c => char.IsLetterOrDigit(c) || "-_.*$+:@&=,!~';()".Contains(c) ? c : '-')
.ToArray());
var actorRef = Context.ActorOf(props, actorName);
_connectionActors[command.ConnectionName] = actorRef;
_log.Info("Created DataConnectionActor for {0} (protocol={1})",