From 731db2541d29085078e4bf7075ed635c8f15e6c5 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 8 Mar 2022 18:28:39 +0800 Subject: [PATCH] load core async, remove Ssl3 --- v2rayN/v2rayN/Forms/MainForm.cs | 9 +++++++-- v2rayN/v2rayN/Tool/Utils.cs | 6 ++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index 15bcc343..15733e9c 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Drawing; using System.Text; using System.Text.RegularExpressions; +using System.Threading.Tasks; using System.Windows.Forms; using v2rayN.Base; using v2rayN.Handler; @@ -463,7 +464,7 @@ namespace v2rayN.Forms /// /// 载入V2ray /// - private void LoadV2ray() + async Task LoadV2ray() { tsbReload.Enabled = false; @@ -471,7 +472,11 @@ namespace v2rayN.Forms { ClearMsg(); } - v2rayHandler.LoadV2ray(config); + await Task.Run(() => + { + v2rayHandler.LoadV2ray(config); + }); + Global.reloadV2ray = false; ConfigHandler.SaveConfig(ref config, false); statistics?.SaveToFile(); diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index dc28ce38..97e1934d 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -719,16 +719,14 @@ namespace v2rayN { if (enableSecurityProtocolTls13) { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 - | SecurityProtocolType.Tls + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13; } else { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 - | SecurityProtocolType.Tls + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; }