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

前端 未结 8 879
栀梦
栀梦 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:26

    I was having same error using DownloadString; and was able to make it works as below with suggestions on this page

    System.Net.WebClient client = new System.Net.WebClient();            
    ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
    string sHttpResonse = client.DownloadString(sUrl);
    

提交回复
热议问题