# ASP.NET出現「根據驗證程序,遠端憑證是無效的。」 ###### tags: `Microsoft` `ASP.NET` ## 錯誤訊息 ![](https://i.imgur.com/4aHz0be.png) ## 解決辦法 設定 HTTPS 連線時,不要理會憑證的有效性問題 ```csharp= // 設定 HTTPS 連線時,不要理會憑證的有效性問題 System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; using(WebClient client = new WebClient()){ var response = client.downloadString(url, data); } ```