c# 中HttpClient访问Https网站,加入如下代码:

handler = new HttpClientHandler() ;
handler.AllowAutoRedirect = true;
handler.UseCookies = true;
handler.CookieContainer = cookies;


System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

或者:
handler.ClientCertificateOptions = ClientCertificateOption.Automatic;

 

httpClient = new HttpClient(handler);

相关文章:

  • 2021-11-14
  • 2022-12-23
  • 2021-07-06
  • 2021-06-21
  • 2021-06-07
  • 2022-12-23
  • 2021-09-23
  • 2021-05-02
猜你喜欢
  • 2021-08-15
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-06-15
相关资源
相似解决方案