fix: Remove explicit security policy setting from OPC UA client
Let the client automatically negotiate security policy with the server instead of trying to set it explicitly
This commit is contained in:
parent
2bad8c9ea0
commit
9c92c5c47f
|
|
@ -23,12 +23,15 @@ class OPCUAClient:
|
|||
"""Connect to OPC UA server."""
|
||||
try:
|
||||
from asyncua import Client
|
||||
from asyncua.crypto.security_policies import SecurityPolicyBasic256Sha256
|
||||
|
||||
self._client = Client(url=self.endpoint)
|
||||
|
||||
# Explicitly set security policy to match server configuration
|
||||
# The server supports both Basic256Sha256 and None security policies
|
||||
# Use None for development/testing
|
||||
await self._client.set_security_string("http://opcfoundation.org/UA/SecurityPolicy#None")
|
||||
# Try connecting without explicit security policy first
|
||||
# The client should automatically negotiate with the server
|
||||
|
||||
# Set timeout for connection
|
||||
await asyncio.wait_for(self._client.connect(), timeout=5.0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue