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

@@ -8,7 +8,6 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/base64"
"github.com/xtls/xray-core/features/dns"
"os"
"slices"
"strings"
@@ -451,7 +450,7 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
if len(c.EchConfigList) > 0 || len(c.EchServerKeys) > 0 {
err := ApplyECH(c, config)
if err != nil {
if c.EchForceQuery || errors.Cause(err) != dns.ErrEmptyResponse {
if c.EchForceQuery == "full" {
errors.LogError(context.Background(), err)
} else {
errors.LogInfo(context.Background(), err)