C# Ignore certificate errors?

后端 未结 11 1024
鱼传尺愫
鱼传尺愫 2020-11-22 15:01

I am getting the following error during a web service request to a remote web service:

Could not establish trust relationship for the SSL/TLS secure c

11条回答
  •  清酒与你
    2020-11-22 15:45

    This works for .Net Core. Call on your Soap client:

    client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication =
                    new X509ServiceCertificateAuthentication()
                    {
                        CertificateValidationMode = X509CertificateValidationMode.None,
                        RevocationMode = X509RevocationMode.NoCheck
                    };  
    

提交回复
热议问题