**I am trying to connect a WinCC OPCUA Server enabled with Basic256Sha256 with Sign&Encrpyt.
How to generate / get the .der file on / from WinCC and the .pem file from the WinCC ?
WinCC OPCUA Server is deployed on AWS Windows EC2 Instance.**
What will be the client connection code that will be used to connect to the WinCC OPC UA Server enabled with Basic256Sha256 with Sign&Encrpyt. ?
I need the .der file and the .pem file for my Python OPCUA Client .
How to generate the .der file and the .pem file ?
After the files are generated do i need to keep the files on WinCC OPC UA Server and the OPC UA Client?
Code 1:
client = Client("opc.tcp://localhost:4840/freeopcua/server/")
#client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
client.set_security_string("Basic128rsa15 ,SignAndEncrypt,certificate-example.der,private-key-
example.pem")
client.application_uri = "urn:example.org:FreeOpcUa:python-opcua"
client.secure_channel_timeout = 10000
client.session_timeout = 10000
Code 2:
logging.basicConfig(level=logging.WARN)
client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/")
client.load_client_certificate("server_cert.pem")
client.load_private_key("mykey.pem")
Code 3:
logging.basicConfig(level=logging.DEBUG) client = Client("opc.tcp://localhost:53530/OPCUA/SimulationServer/") client.set_security_string("Basic128rsa15 ,Sign,certificate-example.der,private-key-example.pem")