fix: hardcode tls SecurityProtocol tls1.2 and tls 1.3

This commit is contained in:
ChsBuffer
2020-12-07 17:50:08 +08:00
parent 464abef28a
commit 5ed25de9ee

View File

@@ -8,6 +8,11 @@ namespace Netch.Utils
{
public static class WebUtil
{
static WebUtil()
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
}
public const string DefaultUserAgent =
@"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36";