在测试中经常会遇到请求一些https的url,但又没有本地证书,这时候可以用下面的方法忽略警告 var httpclientHandler = new HttpClientHandler(); httpclientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, error) => true; var httpClient = new HttpClient(httpclientHandler);…