From e95b5e04c026d01fe1b7058f16445daeff903a1e Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 11 Apr 2022 19:16:35 +0800 Subject: [PATCH] remove expired tls --- v2rayN/v2rayN/Base/HttpClientHelper.cs | 6 +++--- v2rayN/v2rayN/Tool/Utils.cs | 9 ++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/v2rayN/v2rayN/Base/HttpClientHelper.cs b/v2rayN/v2rayN/Base/HttpClientHelper.cs index 2fa75a24..e5de5ad2 100644 --- a/v2rayN/v2rayN/Base/HttpClientHelper.cs +++ b/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); } } diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index a3c11f79..76922378 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/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; }