opcsample icon indicating copy to clipboard operation
opcsample copied to clipboard

Opc.Ua.ServiceResultException: 'SHA1 signed certificates are not trusted.' when I try to connect with user and password.

Open AlessandroVaia opened this issue 1 year ago • 1 comments

When I try to connect with user and password I get a Opc.Ua.ServiceResultException with this message: "SHA1 signed certificates are not trusted."

This is my code

` OpcUaClientBuilder builder = new OpcUaClientBuilder() .WithEndpoint(url) .WithAutoAcceptUntrustedCertificate(true) .WithAccount(user, password) .WithEventCertificateValidationHandler(new CertificateValidationEventHandler(OnCertificateValidation)) .WithClientId(clientName);

private void OnCertificateValidation(CertificateValidator validator, CertificateValidationEventArgs e) { if (e.Error.StatusCode == StatusCodes.BadCertificateUntrusted) { e.Accept = true; } } `

How can I connect to my opc with just user and passowrd? How I can set RejectSHA1SignedCertificates to false?

Regards.

AlessandroVaia avatar Apr 29 '24 15:04 AlessandroVaia

.WithConfiguration((ac) => { ac.CertificateValidator = new CertificateValidator() { RejectSHA1SignedCertificates = false }; }) Add this

showerror avatar Oct 25 '24 03:10 showerror