From 0991024b4547994af6330be4b49723ba910229c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Wed, 3 Jun 2026 17:42:15 +0000 Subject: [PATCH] Handle ECH H2C query correctly Co-Authored-By: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com> --- transport/internet/tls/ech.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/internet/tls/ech.go b/transport/internet/tls/ech.go index 9de124c1c..4755cd4fd 100644 --- a/transport/internet/tls/ech.go +++ b/transport/internet/tls/ech.go @@ -234,6 +234,9 @@ func dnsQuery(server string, domain string, sockopt *internet.SocketConfig) ([]b if err != nil { return nil, 0, err } + // h2c: in config is just for claim + // change scheme to https and expect outbound to handle TLS (freedom + tlsSetting) + req.URL.Scheme = "https" req.Header.Set("Accept", "application/dns-message") req.Header.Set("Content-Type", "application/dns-message") utils.TryDefaultHeadersWith(req.Header, "fetch")