How to setup the zenon OPC UA Driver with a self-signed certificate
This article describes how to create a self-signed certificate for using it with the zenon OPC UA Driver.
Pre-requisites
- xca: X certificate and key management
- zenon Engineering Studio
Creating a self-signed certificate using xca
- Open the tool xca.
- Create a new data base
Create a private key

- Go to the tab Private Keys and press New Key
- Provide a name for the key
- Press Create
Export the private key
- Select the newly generated key and press Export
- Provide a file name for the key
- Ensure that the export format is set to PEM private
- Press OK
For security reasons, the file containing the private key shall only be deployed to the machine running the OPC UA Driver!
Create a new certificate
- Go to the tab Certificates and press New Certificate
- Select Create a self signed certificate
Set the subject of the new certificate
- Go to the tab Subject
- Enter an internal name for the certificate
- Provide information about your organization (not mandatory, but best practice)
- Ensure to select the private key created in the previous steps
Set the extensions of the new certificate
- Go to the tab Extensions
- Set X509v3 Basic Constraints to:
- Type: End Entity
- Path length: 0
- Select Critical
- Set Key identifier:
- Select X509v3 Subject Key Identifier
- Select X509v3 Authority Key Identifier
- Set validity as required
- Set X509v3 Subject Alternative Name:
- URI:[ApplicationUri],DNS:[hostname]
- The ApplicationUri by default is:
urn:[hostname]
The hostname does not contain the domain part (no FQDN!)
Set the key usage of the new certificate
- Go to the tab Key usage
- Set X509v3 Key Usage:
- Select Critical
- Select Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment, Certificate Sign
- Set X509v3 Extended Key Usage:
- Select Critical
- Select TLS Web Client Authentication
- Press OK
Export the certificate
- Select the newly generated certificate and press Export
- Provide a file name for the certificate and ensure to set the file extension to .der
- Ensure that the export format is set to DER
- Press OK
Using the certificate in the zenon project
Add the files to the zenon project
- Switch to your zenon project and add an OPC UA Client driver
- Configure the connection to the OPC UA server (without setting the certificates)
- Go to the project folder Files->Drivers->PKI->CA

- Add the exported private key (*.pem) to the subfolder private
- Add the exported certificate (*.der) to the subfolder certs
- Also add the server certificate to the subfolder cert

In this example the file uaservercpp.der represents the server certificate
- Finally, go back to the driver instance and open the Certificates tab in the server configuration
- Select the recently imported certificates

- Now, you can read the PLC variables in the background and import variables
It might be required to add the newly generated client certificate to the configuration of the OPC UA server, too.