Skip to content

Commit

Permalink
Merge pull request #91 from nanwanwang/patch-1
Browse files Browse the repository at this point in the history
Update HttpHelper.cs
  • Loading branch information
ferventdesert committed Sep 10, 2018
2 parents f4b3a85 + e413f80 commit dc6396e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Hawk.Core/Utils/HttpHelper.cs
Expand Up @@ -432,10 +432,11 @@ private HttpWebRequest SetRequest(HttpItem item, string desturl = null, string p
// 验证证书
if (url.Contains("https"))
{
ServicePointManager.ServerCertificateValidationCallback =

.ServerCertificateValidationCallback =
(sender, certificate, chain, sslPolicyErrors) => true;
//ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls|(SecurityProtocolType)768|(SecurityProtocolType)3072;
request.ProtocolVersion = HttpVersion.Version10;
}
SetRequest(item, request, desturl, post);
Expand Down Expand Up @@ -618,4 +619,4 @@ public enum ResultType
String, //表示只返回字符串
Byte //表示返回字符串和字节流
}
}
}

0 comments on commit dc6396e

Please sign in to comment.