diff --git a/common/tls/reality_client.go b/common/tls/reality_client.go index be4806fe..2ef71854 100644 --- a/common/tls/reality_client.go +++ b/common/tls/reality_client.go @@ -30,7 +30,6 @@ import ( "github.com/sagernet/sing-box/adapter" C "github.com/sagernet/sing-box/constant" "github.com/sagernet/sing-box/option" - "github.com/sagernet/sing/common" "github.com/sagernet/sing/common/debug" E "github.com/sagernet/sing/common/exceptions" "github.com/sagernet/sing/common/logger" @@ -146,22 +145,6 @@ func (e *RealityClientConfig) ClientHandshake(ctx context.Context, conn net.Conn if err != nil { return nil, err } - for _, extension := range uConn.Extensions { - if ce, ok := extension.(*utls.SupportedCurvesExtension); ok { - ce.Curves = common.Filter(ce.Curves, func(curveID utls.CurveID) bool { - return curveID != utls.X25519MLKEM768 - }) - } - if ks, ok := extension.(*utls.KeyShareExtension); ok { - ks.KeyShares = common.Filter(ks.KeyShares, func(share utls.KeyShare) bool { - return share.Group != utls.X25519MLKEM768 - }) - } - } - err = uConn.BuildHandshakeState() - if err != nil { - return nil, err - } if len(uConfig.NextProtos) > 0 { for _, extension := range uConn.Extensions { diff --git a/common/tls/utls_client.go b/common/tls/utls_client.go index 16d0352d..7c34bff2 100644 --- a/common/tls/utls_client.go +++ b/common/tls/utls_client.go @@ -363,6 +363,8 @@ func init() { weights := utls.DefaultWeights weights.TLSVersMax_Set_VersionTLS13 = 1 weights.FirstKeyShare_Set_CurveP256 = 0 + weights.CurveIDs_Append_X25519 = 1 + weights.KeyShare_Append_RandomGroups = 1 randomizedFingerprint = utls.HelloRandomized randomizedFingerprint.Seed, _ = utls.NewPRNGSeed() randomizedFingerprint.Weights = &weights