Skip to content

Error occurred while using security mode is Sign to connect to OPC-UA serverΒ #110

@lindseysimple

Description

@lindseysimple

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in device-opc-ua service.

Is this a regression?

No.

Description and Minimal Reproduction [REQUIRED]

  1. Followed the instructions on the GettingStarted guide and used the predefined OPC-UA device and profile to setup the environment.
  2. Update the device-opc-ua section on the docker compose file to update the security config of the OPC-UA connection.
device-opc-ua:
  ...
  environment:
    ...
    EDGEX_OVERWRITE_CONFIG: true
    WRITABLE_LOGLEVEL: DEBUG
    OPCUASERVER_POLICY: Aes256Sha256RsaPss
    OPCUASERVER_MODE: Sign
    OPCUASERVER_CERTFILE: /certs/rsa_cert.pem
    OPCUASERVER_KEYFILE: /certs/rsa_private.pem
  volumes:
    ...
    - "${PWD}/certs:/certs"
  1. Start EdgeX services by running docker compose up -d
  2. Update the SimulationServer device metadata to use the correct host IP of Prosys OPC-UA server on my machine.
  3. Invoke the GET command: https://localhost:59882/api/v3/device/name/SimulationServer/Counter

πŸ”₯ Exception or Error


level=DEBUG ts=2025-03-05T12:48:24.291697403+08:00 app=device-opcua source=readhandler.go:26 msg="Driver.HandleReadCommands: protocols: map[opcua:map[Endpoint:opc.tcp://192.168.1.102:53530/OPCUA/Simulatio
nServer]] resource: Counter attributes: map[nodeId:ns=3;i=1002]"                                                                                                                                            
level=WARN ts=2025-03-05T12:48:24.301201643+08:00 app=device-opcua source=readhandler.go:36 msg="Driver.HandleReadCommands: Failed to connect OPCUA client, %!s()"
level=ERROR ts=2025-03-05T12:48:24.301277138+08:00 app=device-opcua source=restrouter.go:170 X-Correlation-ID=16650b8c-2a84-4a8d-a43f-a48af2bdc259 msg="error reading Regex DeviceResource(s) Counter for Si
mulationServer -> The security policy does not meet the requirements set by the server. StatusBadSecurityPolicyRejected (0x80550000)"
level=DEBUG ts=2025-03-05T12:48:24.301315844+08:00 app=device-opcua source=restrouter.go:171 X-Correlation-ID=16650b8c-2a84-4a8d-a43f-a48af2bdc259 msg="[github.com/edgexfoundry/device-sdk-go/v4@v4.0.0-dev
.25/internal/application/command.go]-github.com/edgexfoundry/device-sdk-go/v4/internal/application.GetCommand(line 68):  -> [github.com/edgexfoundry/device-sdk-go/v4@v4.0.0-dev.25/internal/application/com
mand.go]-github.com/edgexfoundry/device-sdk-go/v4/internal/application.readDeviceResourcesRegex(line 208): error reading Regex DeviceResource(s) Counter for SimulationServer -> The security policy does no
t meet the requirements set by the server. StatusBadSecurityPolicyRejected (0x80550000)"                                                                                                                    

Note: Have verified with security mode is None and the connection can be established successfully.

🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]: 4.0.dev

Anything else relevant?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions