Hi all,
This is my first post here so sorry if the format is bad.
I am using v1.4.11 and using the client-api connecting to the Prosys Simulated Server, for testing. When I am using SecurityMode None, there is no problem in connecting to the server, but when i use Sign or SignAndEncrypt i get the error Bad_IdentityTokenRejected.
I am working on
MacOS btw.
My code sequence is as follow:
- Create a client with UA_Client_new()
- Get Config with UA_Client_getConfig()
- Set default config with UA_ClientConfig_setDefault()
- Edit config
- Set Encryption with UA_ClientConfig_setDefaultEncryption()
- "Try" to connect with UA_Client_connectUsername()
Setting the encryption works fine but as i mentioned, when i try to connect i only get the Bad_IdentityTokenRejected-error.
I have figured out with WireShark that after getting
GetEndpointsResponse, the client send a "
CloseSecureChannelRequest" straight away and the connection terminates (see image below).

This would make sense if the endpoint(s) did not match my setup, that is where I am lost. In the server I have the following three endpoints, where the first matches the one I want.

Which also seems correct from WireShark (or am I wrong here?)
Does anyone see what I am doing wrong? I am new to both OPC UA and this SDK, so most likely i have missed something, but I can not for the life of me figure out what!
Also, if any more information, exact code, or else is need, please let me know!
Thank you,
- Adrian, OPC UA beginner