日本語 English

Connecting to a PLC via OPC UA (With Security)

How to connect to a PLC with OPC UA security enabled

OPC UA

Here we connect with user authentication and encryption
Only the security part is described, based on no security
I do not know the official way, but I was able to connect with these steps

Overall flow

  1. PLC security settings
  2. Connect once from the client
  3. Move the certificate from rejected to trusted in the PLC's client authentication
  4. Connect from the client again

PLC OPC UA security settings

OPC UA Server Settings - Security Settings

While online,
right-click "OPC UA Server Settings" and open "Security Settings"
OPC UA server settings security settings screen

Prohibit "Anonymous login", uncheck None under "Security policy" and transfer OPC UA server settings security policy screen

Connect once from the OPC UA client (for UaExpert)

When creating a new connection setting, select the policy, enter the Username and Password and create the connection setting UaExpert connection settings screen

Connecting with the created connection setting outputs the error
Error 'BadSecurityChecksFailed' was returned during OpenSecureChannel

Proceed to client authentication as is
BadSecurityChecksFailed error screen

How to register an OPC UA client certificate

Client authentication

Select client authentication while online with the PLC
OPC UA client authentication screen

Trusted certificates

The certificate of UaExpert or Prosys OPC UA Client remains as a rejected certificate under Rejected Certificates at the bottom of the client authentication screen
OPC UA client authentication rejected certificates

Press the "Move to Trusted Certificates" button to move it to trusted certificates
Move the OPC UA client certificate to trusted certificates

Connect from the client again

The connection succeeded
UaExpert reconnect

Mobile apps, PC apps and others

For the mobile app (Prosys OPC UA Client)

Connect once

When adding with Add new connection, check Secure connection

Check Secure connection and Add
Prosys OPC UA Client Secure connection

Tap the added connection setting to try connecting
Prosys OPC UA Client connection

An error is displayed
Prosys OPC UA Client error display

To client authentication

Proceed to client authentication as is, move it from "Rejected Certificates" to "Trusted Certificates" and connect again

Reconnect

The connection succeeded
Prosys OPC UA Client reconnect

NOTE
The mobile version of Prosys OPC UA Client seems to support only anonymous login, so set the PLC to Anonymous

The same applies to Python, C# and other applications

Connect once → client authentication → reconnect

Frequently Asked Questions (FAQ)

What is BadSecurityChecksFailed?

An error that occurs when the client certificate is not trusted on the OPC UA server side.

Why can't UaExpert connect?

The client certificate may be registered as a rejected certificate.

Can anonymous login be used with OPC UA?

Yes, if it is allowed in the PLC settings.

Related pages

Comments