.net HttpWebRequest请求 “请求被中止: 未能创建 SSL/TLS 安全通道”
之前的请求一直好好的,由于签名变化,新的请求访问就出现这个问题;
解决办法:在请求之前添加
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
注意:必须在建立HttpWebRequest之前添加;