You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not really an issue but I dont know where to ask help.
I am new to OPC and I would like to have some help on how to set up the application certificate to connect to a server.
Thanks to all.
Frank !
The text was updated successfully, but these errors were encountered:
I know its a super late reply, but I assume this still may help someone. If when connecting you are seeing the exception that certificate is required. The solution below assumes you have a X509 certificate present as a file, if not, you can easily create one and then add that certificate as a trusted client certificate in your opc server(for Kepware this is done by: right clicking the kep ServerEx tray, Open OPC UA Configuration manager and then add then import the certificate file to the trusted clients tab)
Add the following code before you call the .connect method
var options = new UaClientOptions {};
// The path to the certificate.
string Certificate = @"C:\ProgramData\OPC Foundation\CertificateStores\MachineDefault\certs\cert.der";
// Load the certificate into an X509Certificate object.
X509Certificate2 cert = new X509Certificate2();
cert.Import(Certificate);
options.ApplicationCertificate = cert;
This is not really an issue but I dont know where to ask help.
I am new to OPC and I would like to have some help on how to set up the application certificate to connect to a server.
Thanks to all.
Frank !
The text was updated successfully, but these errors were encountered: