WebClient 指定安全协议(Tls1.1,Tls1.2,Tls1.3)

WebClient 指定安全协议(Tls1.1,Tls1.2,Tls1.3) 

try
{
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13; 
    var client = new WebClient();
    var bytes = client.DownloadData("https://xxx");
}
catch (Exception ex)
{
    throw;
}
原文地址:https://www.cnblogs.com/anjou/p/15010695.html