OPC UA Client Certificate - Industrial Communication Toolbox using old certificate

Dear MathWorks community,
recently my Windows PC's "Computer Name" had to be changed. Since then I can no longer connect to OPC UA servers using the Industrial Communication Toolbox. I suspect this is due to the client certificate (which contains the computer name) not being updated automatically. The error I'm getting is:
Error using opc.ua.Client/connect
The URI specified in the ApplicationDescription does not match the URI in the Certificate.
I tried uninstalling and reinstalling the toolbox as well as completely uninstalling Matlab and deleting related files (e.g. C:\Users\user\AppData\Roaming amongst others) to no avail.
Following screenshot from the Prosys Simulation Server shows the certificate being used by Matlab. It uses an old certificate, even though I reinstalled Matlab and the Industrial Communication Toolbox from scratch.
Is there a way to update the client certificate or at least delete it so that a new installation would create a new/correct version?
Many thanks in advance for a reply and best regards,
Imanuel

 Accepted Answer

I found the answer myself. Do the following if you have the same problem:
1) Find the direcotry where the certificate is stored on your machine:
certStore = fullfile(getenv('ProgramData'),"MathWorks","OpcUaCertStore");
2) Go to the certStore directory and delete the folder 'OpcUaCertStore' to get rid of the old certificate.
3) Next time you connect to an OPC UA server, a new client certificate will be generated automatically.
uaClient = opcua(uaEndpoint);
connect(uaClient);
Best regards,
Imanuel

More Answers (0)

Products

Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!