if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase)){
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback((object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) =>
{
return true;
});
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
}
namespace System.Net
{
[System.Flags]
public enum SecurityProtocolType
{
Ssl3 = 48,
Tls = 192,
Tls11 = 768,
Tls12 = 3072,
}
}
c# .net 4.0 HttpWebRequest 访问https TLS1.2 解决方案
public static string DoRequest(string Url, string cookieStr)
{
HttpWebRequest request = (HttpWebRe