How to setup the zenon OPC UA Process Gateway with a self-signed certificate
This article describes how to create a self-signed certificate for using it with the zenon OPC UA Process Gateway.
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 Process Gateway!
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:[FQDN]
- The ApplicationUri by default is:
urn:[FQDN:PORT]
In both cases, use the fully-qualified domain name (FQDN) in capital letters.
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 Server 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
- Copy the generated files to the PKI folder of the process gateway:
%CD_SYSTEM%\PKI\CA\ - The private key will go into the subfolder private

- The certificate will go into the subfolder certs

- Also put the certificates of trusted clients into the subfolder certs
In this example the file uaexpert.der represents the certificate of a trusted client.
- Switch to your zenon project and add an OPC UA Process Gateway
- Setup the server parameters, variables, and archives as required
- Switch to the tab Endpoints and configure security settings
- Select the generated server certificate and private key

- Now, any client with a valid certificate added to the certs subfolder of the PKI is able to connect to the process gateway.
It might be required to add the newly generated server certificate to the configuration of the OPC UA clients, too.