diff --git a/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs b/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs index 49fd474f..349aee00 100644 --- a/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs +++ b/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs @@ -1,5 +1,3 @@ -using System.ComponentModel.DataAnnotations; - namespace ServiceLib.Handler.Builder; public record CoreConfigContextBuilderResult(CoreConfigContext Context, NodeValidatorResult ValidatorResult) @@ -205,7 +203,7 @@ public class CoreConfigContextBuilder Context = preSocksResult.Context with { ProtectDomainList = - [.. nodeContext.ProtectDomainList ?? [], .. preSocksResult.Context.ProtectDomainList ?? []], + [.. nodeContext.ProtectDomainList, .. preSocksResult.Context.ProtectDomainList], ProtectCoreTypeList = protectCoreTypeList, }, }; @@ -386,7 +384,7 @@ public class CoreConfigContextBuilder { var echQuerySni = node.Sni; if (node.StreamSecurity == Global.StreamSecurity - && node.EchConfigList?.Contains("://") == true) + && node.EchConfigList.Contains("://")) { var idx = node.EchConfigList.IndexOf('+'); echQuerySni = idx > 0 ? node.EchConfigList[..idx] : node.Sni; diff --git a/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs b/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs index cf0dacf0..6ac5002a 100644 --- a/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs +++ b/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs @@ -115,10 +115,10 @@ public class NodeValidator if (item.GetNetwork() is nameof(ETransport.ws) && item.EchConfigList.IsNullOrEmpty() - && item.GetAlpn()?.FirstOrDefault() == "h3") + && item.GetAlpn()?.FirstOrDefault() is "h3" or "h2") { v.Warning( - "WebSocket but ALPN is set to h3, the core may ignore the ALPN setting or cause unexpected issues."); + $"WebSocket but ALPN is set to {item.Alpn}, the core may ignore the ALPN setting or cause unexpected issues."); } // TLS & Security @@ -131,14 +131,6 @@ public class NodeValidator isCertProvided = false; } - // Check for deprecated allowInsecure property when TLS is enabled - if (item.GetAllowInsecure() - && item.Cert.IsNullOrEmpty() - && item.CertSha.IsNullOrEmpty()) - { - v.Warning(ResUI.MsgAllowInsecureDeprecated); - } - if ((coreType == ECoreType.Xray && item.GetAllowInsecure() && !isCertProvided @@ -147,6 +139,10 @@ public class NodeValidator && item.GetAllowInsecure() && !isCertProvided)) { + if (coreType == ECoreType.Xray) + { + v.Warning(ResUI.MsgAllowInsecureDeprecated); + } v.Warning(ResUI.MsgInsecureConfiguration); } }