IMDHMIControls LibraryShop main store

How-to

Trusting the Citect OPC UA client certificate on a B&R PLC

SCADA and data logging Published 6 min read

Short answer

OPC UA checks certificates in both directions, so a working UAExpert connection only proves the server side. On the B&R CPU Configuration page, open the OPC UA configuration, create the server certificate if there is none, and add the Citect client's public certificate to the trusted clients; then select the same security policy in Citect and the controller.

On this page
  1. Trust runs in both directions
  2. Where the controller accepts the client certificate
  3. Trusting the certificate, step by step
  4. Match the name in the URL, and the user under it
  5. Check the clocks before you regenerate anything
  6. What still fails after trust is mutual
  7. The decision
  8. Questions asked

OPC UA checks certificates in both directions, so while Citect decides whether to trust the controller, the controller decides whether to trust Citect - and that second decision is the one you have not made. The acceptance happens on the controller, in the OPC UA configuration on the CPU Configuration page, the same place the server's own certificate is created. Out of the box this controller verifies no certificates, so the unsecured UAExpert session worked; Citect is dialing a secured endpoint, and the controller's half of the trust is the step you are missing. Work the steps below, then take the decision at the end.

Trust runs in both directions #

The security model part of OPC UA, IEC 62541-2 (OPC 10000-2), requires each side on a secured endpoint to verify the other application's certificate before the session is created, and requires the client to check that the endpoint URL it dialed matches a host name written in the server certificate. Importing the PLC's certificate into Citect satisfies only the client's half of that. The controller's half stays open no matter how often Citect retries.

If you never accepted a UAExpert certificate on this controller, its successful session ran on the unsecured endpoint - a different test from the one Citect is failing. A trust fault on either side usually reports as BadSecurityChecksFailed; resolving BadSecurityChecksFailed in UaExpert runs the same checks from the other end of the channel, which makes it a useful mirror while you fix the server side.

Where the controller accepts the client certificate #

The OPC UA server's security settings on a B&R CPU are not spread across dialogs: they sit in the OPC UA configuration on the CPU Configuration page, and that page is where the missing step from the walk-through happens. There you create the server's own certificate, and there you accept the client certificates the server should trust. From the factory this configuration runs with no security certificates, so any client can open the unsecured endpoint and nothing is verified. The rule is the one behind configuring OPC UA server certificates and trust stores: move the client's public certificate into the trusted list, and nothing else changes hands.

Trusting the certificate, step by step #

  1. Record what the working UAExpert connection actually used: endpoint URL, security policy, message security mode and user identity. That record is your baseline, and nothing in it transfers to Citect by itself.
  2. Open the CPU Configuration page in the B&R project and read its OPC UA configuration: which security settings are enabled and which certificates exist.
  3. Decide the policy now, because every later step depends on it: a secured policy with certificates for this deployment, or SecurityPolicy None kept to an isolated control network.
  4. If the server has no certificate yet, create one on that page and give it the exact host name or IP address the clients will dial, since the URL-to-host-name check is part of the standard.
  5. On the Citect runtime host, open the OPC UA configurator and export the public certificate of the client application that will actually connect - not a certificate from your laptop or from a test install.
  6. Accept that public certificate in the controller's trusted-client list, comparing the full 64-character SHA-256 fingerprint on both sides before you confirm. Move the public certificate only: the private key never leaves the application that generated it, because whoever holds it can impersonate that client.
  7. Accept the controller's server certificate inside the Citect configurator, so the client's half of the mutual check passes too.
  8. In Citect, select the same endpoint URL, security policy and message security mode you set on the controller - a secured pairing is typically Basic256Sha256 with SignAndEncrypt - and set the user identity the server expects.
  9. Transfer the configuration to the controller, reconnect Citect, and confirm the session activates and the first reads return good quality. Then leave the trust lists alone.

Match the name in the URL, and the user under it #

Two mismatches survive a correct trust list. First, the URL: if the server certificate was created for the name PLC-07 and Citect dials 192.168.1.40, the required host-name check fails and the channel closes as a security fault. Dial the name the certificate carries, or recreate the certificate with the address the clients use. Second, the user: the application certificate proves which program is talking, while the user token inside the session decides what that session may read - the split behind OPC UA user certificates as access keys rather than application trust. A trusted certificate carrying an unauthorized user connects and reads nothing.

Check the clocks before you regenerate anything #

Validity is judged against local clocks, and clock error reproduces exactly like a trust fault. Worked example, illustrative times: the Citect runtime host clock reads 2025-03-05 14:20 UTC and the exported client certificate shows NotBefore 2025-03-05 18:00:00 UTC. 18:00:00 - 14:20:00 = 3 h 40 min, so for the next 3 h 40 min the certificate does not exist yet as far as the controller is concerned, and every session attempt in that window is refused as a security failure. The same subtraction catches expiry: NotBefore 2025-03-05 18:00:00 UTC to NotAfter 2027-03-05 18:00:00 UTC is 730 days of life, and a controller whose clock reads 2027-03-12 rejects it 7 days late. Point both hosts at one time source before regenerating anything.

What still fails after trust is mutual #

What you see Where to look What it means
Channel refused before any read, BadSecurityChecksFailed Controller OPC UA diagnostics, Citect driver log Certificate not trusted, policy or mode mismatch, URL-to-host-name mismatch, or clock outside validity
Session activates, values return bad quality Citect item setup, controller user permissions Node identifier, namespace, data type or read permission - not a certificate fault
Connects, then values stop updating Server side Server-side fault over time, not a first-connect trust fault
Tag updates, screen object stays blank Graphics binding Display expression points at the wrong tag

A session that activates while particular writes are refused is an item or permission fault, the pattern of robot output writes over OPC UA refused in one direction. A client that connects and then stops returning values hours or days later points at the server, as in CODESYS OPC DA memory growth stopping SCADA reads.

The decision #

  • Deploy secured: accept Citect's public certificate on the CPU Configuration page, accept the controller's certificate in the Citect configurator, run both ends on one secured policy such as Basic256Sha256 with SignAndEncrypt, and put both clocks on one time source. That is the configuration to leave behind when you drive away.
  • If this network is isolated and site rules allow it, SecurityPolicy None on both ends connects today with no certificate step. Treat it as a stopgap on an isolated segment, never on a routed one.
  • If the session activates and the values are bad, stop editing certificates: the fault is in the node, the namespace or the user's permissions, and it will still be there after trust is perfect.

Questions asked

Why did UAExpert connect without any certificate step?

Because it used the unsecured endpoint. UAExpert also creates its own self-signed certificate on first start, but on a SecurityPolicy None endpoint that certificate is never examined and no trust decision happens on either side. Point UAExpert at the secured endpoint you want Citect to use and it will be rejected the same way until its certificate is trusted, which makes it an honest baseline for the Citect settings.

Can we set both ends to SecurityPolicy None and move on?

It will connect, and on a physically isolated control network it is defensible. A None session has no encryption and no proof of who is at the far end, so anything on that segment can read and write the same tags. Wherever the segment is switched or routed with other traffic, keep a secured policy such as Basic256Sha256 with SignAndEncrypt and do the trust exchange in both directions.

The controller reports the certificate as not yet valid. What changed?

It is a clock problem, not a trust problem. Every certificate carries a start time, and a controller that lost power without a buffered clock can boot months or years early, landing before that start time. Compare the controller clock against the certificate's NotBefore field, correct the clock from a common time source, and retry before you regenerate anything.

When does the accepted certificate take effect?

When the project reaches the controller. Entries on the CPU Configuration page, including the trusted-client list, are project data that take effect at transfer, not when the dialog closes. Reconnect Citect only after the transfer finishes, or you will test against the previous state and chase a fault you already fixed.

Keep reading

  • Troubleshooting

    Fixing CODESYS OPC DA memory growth stopping SCADA reads

    The reads stop because WinCoDeSysOPC.exe, a 32-bit OPC DA server process, climbs to its 2 GB memory ceiling over weeks and then stops serving tags; killing it only resets the clock. The resolution that held was installing the current, licensed CODESYS OPC DA server — 3.5.22.40 in place of the CODESYSV35SP10Patch2 install — and proving it through the old failure window.

    SCADA and data logging

  • Selection guide

    SCADA and PLC platform selection for plant revamps

    Judge the whole chain — engineering tool, exact controller, fieldbus role, OPC UA endpoint, SCADA runtime and client — not the IDE alone. Freeze pass-or-fail gates on the license boundary, target hardware, fieldbus, OPC UA and documentation, then pilot one representative plant unit on the real controller. Adopt only after deployment, protocol behavior, diagnostics and failure recovery all pass there; until then the incumbent platform stays the baseline.

    SCADA and data logging

  • Troubleshooting

    How a SCADA client reads a small PLC over EtherNet/IP

    An Ethernet link to a MicroLogix is not a working SCADA read: the controller serves data through PCCC commands carried over EtherNet/IP, and a client without that application service gets every read rejected. Check the driver's documented controller list for PCCC over EtherNet/IP or use the controller's documented Modbus TCP server, then prove one read-only value end to end.

    Industrial networks