OPC Data Client - OPC UA Self-Signed Certificate Not Trusted
This is not an issue with the OPC UA Client trusting the OPC UA Server certificate, but rather the OPC UA Client's certificate being in the correct Certificate Store on your PC.
When attempting to connect to an OPC UA Server from my custom OPC UA Client made with the OPC Data Client toolkit, I am met with the following error:
OPC-UA service result - Self Signed Certificate is not trusted.
IssuerName: CN=EasyOPC-UA Demo, DC=kubernetes.docker.internal = BadCertificateUntrusted.
---- SERVICE RESULT ----
Status Code: {BadCertificateUntrusted} = 0x801A0000 (2149187584)
-=-=-Description: Self Signed Certificate is not trusted.
IssuerName: CN=EasyOPC-UA Demo, DC=kubernetes.docker.internal
Additional Info:
My OPC UA Server certificate is trusted by my OPC UA Client, so why am I seeing this error?
- Find the UA Configuration Tool (Opc.Ua.ConfigurationTool.exe in C:\Program Files (x86)\Software Toolbox OPC Data Client 2020.3\Bonus\Opc.Ua.ConfigurationTool) and run as administrator. If the UA Configuration Tool is not installed, see the note at the bottom of this entry.
- Go to the Manage Certificates tab.
- Choose %CommonApplicationData%\OPC Foundation\CertificateStores\MachineDefault from the Store Path drop-down menu.
- Click View Certificates and find the certificate for your OPC UA Client Application.
- Right-click on your certificate and choose Copy.
- Click OK and return to Manage Certificates tab.
- Choose %CommonApplicationData%\OPC Foundation\CertificateStores\UA Applications from the Store Path dop-down menu.
- Click View Certificates.
- Right-click where the certificates are listed and choose Paste.
- The application certificate should now be in the UA Applications directory.
- The private key should NOT be copied over. Please go to C:\ProgramData\OPC Foundation\CertificateStores\UA Applications\private and confirm that it is not there.
NOTE: If this on a deployment machine and you used the Production Installer, the UA Configuration Tool will not be installed. Instead, you may download that separately here: UA Configuration Tool Download