This commit is contained in:
DHR60
2026-08-19 05:48:59 +00:00
committed by GitHub
parent 11bd52b6a5
commit 2d514ff480
2 changed files with 8 additions and 14 deletions

View File

@@ -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;

View File

@@ -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);
}
}