Bypass invalid SSL certificate errors when calling web services in .Net

前端 未结 8 864
栀梦
栀梦 2020-11-28 20:33

We are setting up a new SharePoint for which we don\'t have a valid SSL certificate yet. I would like to call the Lists web service on it to retrieve some meta data about th

8条回答
  •  北海茫月
    2020-11-28 21:08

    Like Jason S's answer:

    ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
    

    I put this in my Main and look to my app.config and test if (ConfigurationManager.AppSettings["IgnoreSSLCertificates"] == "True") before calling that line of code.

提交回复
热议问题