Troubleshooting
Why an OPC UA Trust Loop Fails on a Unified Comfort Panel
Short answer
Both sides showing Trusted while the secure session still fails means a validation step behind the trust store is rejecting a certificate. Provision the panel through the WinCC Unified Certificate Manager with the device name ucp-(MAC address), import the complete CA chain and CRL on the controller, and read BadCertificateHostNameInvalid as a hostname mismatch between the endpoint you dial and the server certificate.
On this page
- Why does the session fail when both certificates show Trusted?
- Why do unencrypted reads and a working TIA Portal connection not rule out a certificate fault?
- Which certificate manager does a Unified Comfort Panel need with a third-party controller?
- What device name makes the Unified panel start OPC UA communication?
- Does the ctrlX OPC UA server need a CA certificate?
- What does BadCertificateHostNameInvalid point to?
- Which diagnostics find the first validation failure?
- Questions asked
When both devices show the peer certificate as Trusted and the secure OPC UA session still fails, the rejection happens after trust-store acceptance, in the identity, chain, purpose and revocation checks that run before the channel opens. On a Unified Comfort Panel (MTP1200) engineered in TIA Portal V20 against a ctrlX CORE X3C, three changes moved the work forward: provisioning through the WinCC Unified Certificate Manager instead of the integrated TIA Portal Certificate Manager, a panel device name in the ucp-(MAC address) format, and the complete CA chain with its revocation list imported on the controller. BadCertificateHostNameInvalid is a separate, client-side fault: the host you dial is not a host entry in the server certificate.
Why does the session fail when both certificates show Trusted? #
Because trust-store acceptance is only the first checkpoint: after the controller marks the panel's client certificate Trusted, the channel still runs identity, chain, purpose and revocation checks, and the first one that fails ends the session.
The observed sequence on this configuration was:
- The panel sends its client certificate.
- The controller accepts it and lists it as Trusted.
- The controller sends its server certificate, and the panel accepts it the same way, into its own trust store.
- The panel sends its client certificate again, the controller rejects it, and no session opens.
The repeat send is a retry after a failed attempt, not a second certificate. Under OPC UA (IEC 62541) each side validates the peer application certificate while the secure channel and session are established, and trust-store membership is only one input to that validation. The candidates that remain are the application URI, the issuing chain, the key-usage profile and the revocation status; the diagnostics at the end of this article pick the failing one instead of guessing.
Why do unencrypted reads and a working TIA Portal connection not rule out a certificate fault? #
They exercise different identities: Security Policy = None proves reachability and data access with the certificate checks switched off, and TIA Portal encrypts with its own engineering certificate, not the panel runtime's application certificate.
Reads and writes were stable with Security Policy = None in this installation, which pins the fault to certificate validation rather than reachability or the server data model. Keep that mode as a bench baseline only: with None, tag values and writes cross the wire unprotected, so it is a diagnostic setting and never the operating state. The TIA Portal connection that worked once its certificate was imported and trusted proves the controller handles trust for that one engineering client; the panel runtime is a separate certificate identity, so that success transfers nothing to the panel.
The roles stay fixed: the panel is the OPC UA client and the controller the server, the direction split spelled out in OPC UA server vs client direction. Confirm both tests used the same endpoint as well, since the secure connection can select a different endpoint address or port than the unsecured one; read the endpoint URL from the configured connection instead of assuming the customary port 4840.
Which certificate manager does a Unified Comfort Panel need with a third-party controller? #
The WinCC Unified Certificate Manager: when the controller is not engineered in TIA Portal, it produces a CA certificate and a revocation list for the controller plus an encrypted *.enc certificate package for the panel.
The integrated TIA Portal Certificate Manager workflow fits panels paired with CPUs configured inside the same project. With a third-party controller the panel-side workflow runs through the WinCC Unified Certificate Manager, and the artifacts land like this:
- CA certificate to the controller trust configuration; it must be the issuer of the panel application certificate.
- Revocation list to the controller; its issuer and validity period must match that CA.
- Certificate package (*.enc) to the panel; confirm the installed package belongs to the intended panel identity.
- Device name ucp-(MAC address) as the identity used during generation.
Then compare what the running panel actually presents, subject, issuer, serial number and fingerprint, against the exported application certificate before changing anything on the controller. A CA export and a panel application certificate serve different purposes: if the controller was handed the CA while the checks run against the certificate it issued, that alone produces the observed rejection pattern.
What device name makes the Unified panel start OPC UA communication? #
The device name must follow the ucp-(MAC address) format; with any other name the panel never initiated communication in this installation, and correcting the name to that pattern is what started the certificate exchange.
Take the MAC from the panel device configuration and build the name in the exact form the certificate tool requires; the prefix with a mistyped address resolves nothing. When the panel is completely silent, with nothing sent and nothing rejected, fix this name before touching either trust store. Once the name matched here, the exchange began and the failure moved to the validation stage, which is where commissioning makes progress.
Does the ctrlX OPC UA server need a CA certificate? #
No: self-signed certificates are the documented default for the ctrlX OPC UA server and client, and CA-based trust only works after you import the CA certificate and its revocation list yourself through cert-import, complete chain included.
Any OPC UA client works against that default, and connecting a Windows mobile HMI panel to ctrlX over OPC UA uses the same server-side trust step. If your issuing hierarchy contains intermediate CAs, import the complete chain rather than only the top-level CA. For a single panel, trusting the panel application certificate directly keeps the system small; a CA earns its keep when several panels must rotate or be revoked centrally. The equivalent step on another controller platform, trusting an HMI OPC UA client certificate on the controller, shows the same handshake from the PLC side.
What does BadCertificateHostNameInvalid point to? #
A hostname mismatch between the address you use to connect and the identity in the server certificate: the client compares the endpoint URL host against the certificate host entries, and a miss rejects the certificate regardless of its Trusted status.
The message is raised on the client side: the panel is validating the controller server certificate, so stop reworking the controller trust store. An OPC UA certificate carries its host identity in its Subject Alternative Name, as DNS name and URL entries, and depending on how deeply the client checks, a mismatch is either ignored or fatal. A partial hostname is a common trigger, so dial the fully qualified name.
Worked example with illustrative values:
- Endpoint dialed: opc.tcp://192.168.10.40:4840, where 4840 is the customary OPC UA port and the real port comes from the configured endpoint.
- Server certificate SAN: DNS name ctrlxcore.local and URL urn:ctrlx:core, which is 2 host entries.
- Host used: 192.168.10.40, which matches 0 of those 2 entries.
- 0 matches is below the 1 required, so the session fails with BadCertificateHostNameInvalid.
Pick one of two fixes: connect by a name the certificate already lists, or regenerate the server certificate on the controller so the address you dial is one of its host entries. Controllers that expose their OPC UA server certificate settings document adding the IP address to the certificate for exactly this error.
Which diagnostics find the first validation failure? #
OPC UA server tracing plus a SystemReport, taken across two or three reproductions with the panel diagnostics captured over the same attempts, because the repeated certificate send is a retry and only aligned timestamps expose the first failure.
Enable tracing on the OPC UA server per the instructions for the installed ctrlX application, reproduce the fault two or three times, then collect a SystemReport and an archive holding the active app data and the rejected certificates. Record from that capture:
- The first validation error in the trace, with the fingerprint of the certificate being checked.
- The endpoint address dialed, next to the SAN entries of the certificate checked at that moment.
- The trust-store contents before and after a reboot when the same certificate returns as rejected.
- The logbook pairs 080F0301 0C7A0050 and 0D1E0100 0C761008 kept with their surrounding entries, interpreted through the diagnostic descriptions of the installed product.
Decisions, by case:
- Unsecured works and secure fails: work the certificate path, the network and the data model are proven.
- The panel sends nothing at all: fix the device name to ucp-(MAC address) first.
- Both sides Trusted and then rejected: compare the presented certificate against the intended application certificate, and import the complete CA chain with its revocation list through cert-import.
- BadCertificateHostNameInvalid in the panel diagnostics: match the dialed host to the server certificate SAN, or reissue that certificate.
Questions asked
Can I leave Security Policy = None in place since reads and writes work?
Use it as a bench baseline only. With None, every tag value and every write crosses the network unencrypted and unauthenticated, so anyone on that segment can read and change the process. Get the secure channel working before the machine runs, and treat unsecured operation as a diagnostic mode for isolated tests, not an operating state.
Why does the panel send its client certificate twice?
The second send is a retry after the failed session attempt, not a second identity. Compare the serial number and fingerprint of both sends: when they match, one certificate is being validated over and over, and the reason it fails sits behind the trust store in the chain, purpose, validity or revocation checks.
Should I use a CA or self-signed certificates for a single panel?
Trust the panel's self-signed application certificate directly on the controller: self-signed is the documented ctrlX default, and with one panel you avoid revocation-list handling entirely. Move to a CA when several panels must rotate or be revoked centrally, and then import the complete chain and revocation list through cert-import before the first connection.
The same certificate comes back rejected after every reboot, is the trust store broken?
Read it as a persistence or repeated-validation problem, not a new fault. Record the trust-store contents and the certificate fingerprint before and after the reboot: if the entry persists and the identical fingerprint is rejected again, that certificate fails the same validation check every time, and the trace of the first attempt names which one.
Is the missing Subject Alternative Name on the CA certificate the root cause?
No. A CA certificate normally carries no Subject Alternative Name; the DNS name and URL entries belong on the device certificates it issues. The CA key usage should be keyCertSign and cRLSign, while the issued client certificate carries digitalSignature and keyEncipherment with the clientAuth extended usage. A hostname complaint points at a device certificate SAN, never the CA.