I am using UAExpert application and i am connecting to my machine with these settings:
I want to connect to my device with python. I have this code but it doesn't work.
from opcua import Client
client = Client("opc.tcp://<ip>:4840")
client.set_user("username")
client.set_password("password")
client.set_security_string("Basic256Sha256,Sign,cert.der,key.pem")
client.connect()
I am getting this error:
raise ua.UaError("No matching endpoints: {0}, {1}".format(security_mode, policy_uri)) opcua.ua.uaerrors._base.UaError: No matching endpoints: 2, http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
UPDATE:
I think it's the issue of the certificate. So i found from UAExpert settings where it gets the certificate from.
I use the same path for
cert.der
but i don't know where i can find the key.pem