TLS ECH client: echForceQuery "full" / "half" / "none" (default) (#4973)

https://github.com/XTLS/Xray-core/pull/4971#issuecomment-3148113203
This commit is contained in:
风扇滑翔翼
2025-08-03 18:15:42 +08:00
committed by GitHub
parent 87fff12fd9
commit 7cbf5b004c
6 changed files with 54 additions and 42 deletions

View File

@@ -414,7 +414,7 @@ type TLSConfig struct {
VerifyPeerCertInNames []string `json:"verifyPeerCertInNames"`
ECHServerKeys string `json:"echServerKeys"`
ECHConfigList string `json:"echConfigList"`
ECHForceQuery bool `json:"echForceQuery"`
ECHForceQuery string `json:"echForceQuery"`
ECHSocketSettings *SocketConfig `json:"echSockopt"`
}
@@ -494,6 +494,12 @@ func (c *TLSConfig) Build() (proto.Message, error) {
}
config.EchServerKeys = EchPrivateKey
}
switch c.ECHForceQuery {
case "none", "half", "full", "":
config.EchForceQuery = c.ECHForceQuery
default:
return nil, errors.New(`invalid "echForceQuery": `, c.ECHForceQuery)
}
config.EchForceQuery = c.ECHForceQuery
config.EchConfigList = c.ECHConfigList
if c.ECHSocketSettings != nil {