以下代码:
using System.Net;
namespace HttpsClient
{
class Program
{
static void Main(string[] args)
{
using (var client = new WebClient())
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback
+= (sender, certificate, chain, errors) => true;
var str = client.DownloadString(
"https://ssb.unwsp.edu/pls/banprod/twbkwbis.P_WWWLogin");
}
}
}
}
无法建立连接,以System.Net.WebException结束请求已中止:无法创建SSL / TLS安全通道。
正如Wireshark捕获显示的那样,服务器端拒绝使用TLS 1.2协议。
当ServicePointManager配置为仅使用Ssl3和Tls时,可以成功建立连接。
问题:
由于