在测试中经常会遇到请求一些https的url,但又没有本地证书,这时候可以用下面的方法忽略警告

    var httpclientHandler = new HttpClientHandler();
    httpclientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, error) => true;
    var httpClient = new HttpClient(httpclientHandler);

相关文章:

  • 2021-11-20
  • 2021-09-29
  • 2022-12-23
  • 2021-12-15
  • 2021-06-19
  • 2021-10-17
  • 2022-12-23
猜你喜欢
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案