Browse Source

remove expired tls

pull/2192/head
2dust 3 years ago
parent
commit
e95b5e04c0
  1. 6
      v2rayN/v2rayN/Base/HttpClientHelper.cs
  2. 9
      v2rayN/v2rayN/Tool/Utils.cs

6
v2rayN/v2rayN/Base/HttpClientHelper.cs

@ -183,7 +183,7 @@ namespace v2rayN.Base
using (var stream = await response.Content.ReadAsStreamAsync())
{
var totalRead = 0L;
var buffer = new byte[1024 * 1024];
var buffer = new byte[1024 * 128];
var isMoreToRead = true;
progressPercentage = -1;
DateTime totalDatetime = DateTime.Now;
@ -211,14 +211,14 @@ namespace v2rayN.Base
TimeSpan ts = (DateTime.Now - totalDatetime);
var speed = totalRead * 1d / ts.TotalMilliseconds / 1000;
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
if (progressPercentage != percent && percent % 5 == 0)
if (progressPercentage != percent && percent % 2 == 1)
{
progressPercentage = percent;
progress.Report(speed);
}
}
}
} while (isMoreToRead);
} while (isMoreToRead);
}
}

9
v2rayN/v2rayN/Tool/Utils.cs

@ -753,16 +753,11 @@ namespace v2rayN
{
if (enableSecurityProtocolTls13)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Tls13;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
}
else
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
}
ServicePointManager.DefaultConnectionLimit = 256;
}

Loading…
Cancel
Save