HTTPS Connection Procedure

1. Scope

This document describes a step by step procedure for establishing a secure connection over the HTTPS protocol between an OPC UA Server and an OPC UA Client developed with the .NET stack provided by OPC Foundation.

2. Requirements

The OPC UA 1.02 .NET Sample Applications package needs to be installed on the local machine.

This will deploy the UA Sample Server, UA Sample Client, and UA Configuration Tool applications that are needed for this procedure.

The package can be downloaded from the OPC Foundation website.

3. Procedure description

In order to be able to establish a secure connection the SSL binding needs on the machine where the server application is running. This can be performed using the UA Configuration Tool application.

An HTTPS connection requires a certificate to be used for performing the message encryption. This certificate is different than the application instance certificate of the server.

In a real scenario (e.g. a web site) the HTTPS certificate (or SSL certificate) is issued and signed by a worldwide trusted Certification Authority (e.g. VeriSign, DigiCert) because it should be validated and trusted by the operating system before establishing a connection. For Windows operating systems this means the certificate of the issuer should be in the “LocalMachine\Root” store in order to be considered trusted. This store already contains a list of known CAs (like VeriSign and DigiCert) and the certificates issued by them will be automatically trusted.

In our example we will create our own CA and we use it to issue the HTTPS certificate. After that we will manually copy the CA certificate to the “LocalMachine\Root” store on the machines where the UA client application will run. In this way the HTTPS certificate will be considered trusted by the operating system (i.e. issued by a trusted authority) and we do not need to purchase an HTTPS certificate from an authority.

On a machine where OPC UA 1.02 .NET Sample Applications is installed, perform the following steps:

3.1. Launch the Dashboard application.

The application can be used for launching/stopping the other applications (Sample Client, Sample Server, Configuration Tool…) and can be found at Start -> All Programs -> OPC Foundation -> Unified Architecture -> 1.02 -> Sample Applications -> OPC UA Dashboard.

 image115.gif

3.2. Launch the Configuration Tool application

 image116.gif

3.3. Create a new Certificate Authority

From the Configuration Tool application select the “Manage Certificates” tab and create a new CA certificate the using the “Create Certificate Authority" button.

 image117.gif

Save the certificate somewhere on the disk (e.g. “D:\HTTPS”) and specify a password. In our example we use opcf as password.

 image118.gif

3.4. Import the CA certificate into the trusted root store of the local machine.

From Configuration Tool:

 image119.gif

3.5. Issue a new SSL certificate based on the previously created CA

From Configuration Tool:

 image120.gif

image121.gif

3.6. Create the SSL binding for the HTTPS port using the certificate created in the previous step

From Configuration Tool:

 image122.gif

 image123.gif

3.7. Check the HTTPS connection status on the local machine

In this moment UA Sample Client should be able to establish an HTTPS connection with UA Sample Server.

image124.gif

 image125.gif

An HTTPS connection should be established now between Sample Client and Sample Server.

 image126.gif

3.8. Copy the CA certificate to LocalMachine\Root on the remote client machine.

If the client application runs on a different machine the CA certificate (the certificate generated at step nr. 3) needs to be copied to the LocalMachine\Root store of the client machine.

The Configuration Tool application should be used on the client machine to add the CA in the list of Trusted Root Certification Authorities.

Follow these steps:

 image127.gif

In this moment a UA Sample Client instance running on a remote machine (a machine different than the server machine) should be able to establish an HTTPS connection with UA Sample Server.