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:
@@ -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})",
|
||||
|
||||
Reference in New Issue
Block a user