Connection with security mode ,policy with user name,password and with certs Failing
Hi, Thanks for providing as S2OPC as open source i am using example code "example_wrapper_subscribe" when i complie and run the code without any changes in security mode i am able to get the data but when i changed the security configuration here what i changed in security configuration
if i make change in policyid as i am getting errors
SOPC_ClientHelper_Security security = { .security_policy = SOPC_SecurityPolicy_Basic256Sha256_URI, .security_mode = OpcUa_MessageSecurityMode_SignAndEncrypt, .path_cert_auth = "E:/yash/S2OPC/bin/trusted/cacert.der", .path_crl = "E:/yash/S2OPC/bin/revoked/cacrl.der", .path_cert_srv = "E:/yash/S2OPC/bin/server_public/server_2k_cert.der", .path_cert_cli = "E:/yash/S2OPC/bin/client_private/client_2k_cert.der", .path_key_cli = "E:/yash/S2OPC/bin/client_private/client_2k_key.pem", .policyId = "anonymous", .username = "test", .password = "test", }
This is the logs when Security mode and policy is changed to above
Info: Configure connection to "opc.tcp://192.168.0.2:4840/OPCUA/SimulationServer"
Error: Failed to load client certificate.
Error: Could not configure connection.
Info: Closing the Toolkit.
Info: Toolkit closed.
log when Security mode and policy are none and policy id is changed to certificate_basic256/ other then anonymous
Info: Configure connection to "opc.tcp://192.168.0.2:4840/OPCUA/SimulationServer"
Warning: DISABLED CERTIFICATE VERIFICATION. Info: Configured. Error: Received unexpected message in state 2, switching to error state Error: Could not connect with given configuration id. Info: Closing the Toolkit. Info: Toolkit closed.
the certs are in same location as added in the path when the security mode and policy are set as below we can read the data
.security_policy = SOPC_SecurityPolicy_None_URI, .security_mode = OpcUa_MessageSecurityMode_None, .path_cert_auth = "E:/yash/S2OPC/bin/trusted/cacert.der", .path_crl = "E:/yash/S2OPC/bin/revoked/cacrl.der", .path_cert_srv = "E:/yash/S2OPC/bin/server_public/server_2k_cert.der", .path_cert_cli = "E:/yash/S2OPC/bin/client_private/client_2k_cert.der", .path_key_cli = "E:/yash/S2OPC/bin/client_private/client_2k_key.pem", .policyId = "anonymous", .username = "test", .password = "test",
Can any one suggest on this if am making any wrong configuration please correct me the server i am using is prosys server sumulator
i a need help on this