C# Ignore certificate errors?

后端 未结 11 1165
鱼传尺愫
鱼传尺愫 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:52

    Add a certificate validation handler. Returning true will allow ignoring the validation error:

    ServicePointManager
        .ServerCertificateValidationCallback += 
        (sender, cert, chain, sslPolicyErrors) => true;
    

提交回复
热议问题