Could not connect a client using securitymode and security police

177 views
Skip to first unread message

Joaquim Ferreira Guimarães Neto

unread,
Aug 26, 2022, 2:26:10 PM8/26/22
to open62541
Hi everione

I can't connect a client to a server using "securityMode" other than 0 or 1 , and "securityPolicyUri" other than "" (none). I'm using "UACppServer" server. 

As an example, here is my C++ code:

UA_ClientConfig* cc = UA_Client_getConfig(client);
UA_StatusCode st=UA_ClientConfig_setDefault(cc);
 cc->securityMode = UA_MESSAGESECURITYMODE_SIGN;
 cc->securityPolicyUri = UA_String_fromChars("Basic256Sha256");
st = UA_Client_connect(client, "opc.tcp://DELL-JOAQUIM:48010");

The messages received in the log are:

[2022-08-26 10:12:49.188 (UTC-0300)] warn/userland      AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2022-08-26 10:12:49.189 (UTC-0300)] info/eventloop     Starting the EventLoop
[2022-08-26 10:12:49.190 (UTC-0300)] warn/client        skip verifying ApplicationURI for the SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None
[2022-08-26 10:12:49.221 (UTC-0300)] info/network       TCP 576 | New connection to "DELL-JOAQUIM" on port 48010
[2022-08-26 10:12:49.223 (UTC-0300)] info/channel       TCP 576 | SecureChannel 1370870922      | SecureChannel opened with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None and a revised lifetime of 600.00s
[2022-08-26 10:12:49.224 (UTC-0300)] info/client        Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good
[2022-08-26 10:12:49.226 (UTC-0300)] info/client        Rejecting endpoint 0: security mode doesn't match
[2022-08-26 10:12:49.226 (UTC-0300)] info/client        Rejecting endpoint 1: security policy doesn't match
[2022-08-26 10:12:49.226 (UTC-0300)] info/client        Rejecting endpoint 2: security mode doesn't match
[2022-08-26 10:12:49.226 (UTC-0300)] info/client        Rejecting endpoint 3: security policy doesn't match
[2022-08-26 10:12:49.227 (UTC-0300)] info/client        Rejecting endpoint 4: security mode doesn't match
[2022-08-26 10:12:49.227 (UTC-0300)] info/client        Rejecting endpoint 5: security policy doesn't match
[2022-08-26 10:12:49.227 (UTC-0300)] info/client        Rejecting endpoint 6: security mode doesn't match
[2022-08-26 10:12:49.227 (UTC-0300)] error/client       No suitable endpoint found
[2022-08-26 10:12:49.227 (UTC-0300)] info/client        Client Status: ChannelState: Closing, SessionState: Closed, ConnectStatus: BadInternalError

Could anybody help me? What happens?

Thanks.
Reply all
Reply to author
Forward
0 new messages