clash icon indicating copy to clipboard operation
clash copied to clipboard

[Feature] DNS设置支持开启ECH (TLS Encrypted Client Hello)

Open fuchanghao opened this issue 1 year ago • 1 comments

Verify steps

  • [X] 我已经在 Issue Tracker 中找过我要提出的请求 I have searched on the issue tracker for a related feature request.
  • [X] 我已经仔细看过 Documentation 并无法自行解决问题 I have read the documentation and was unable to solve the issue.

Description

TLS ECH:https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-13

目前已有Chrome/Microsoft Edge v105+ / Firefox 99+等浏览器支持该加密。

浏览器配置方式如下:

Microsoft Edge: https://techcommunity.microsoft.com/t5/discussions/you-can-now-enable-encrypted-client-hello-encrypted-sni-or-esni/m-p/3600372

Firefox:https://github.com/milgradesec/firefox-settings (其中除开Enable Encrypted Client Hello (ECH/ESNI)内容外,还需要network.trr.mode = 3才能生效)

目前已知cloudflare的DNS是支持ECH的,并且启用ECH后对于CF旗下的部分SNI Reset网站可以Direct访问,不再需要做一层本地反代处理。

但是因为Clash开启TUN模式就要在浏览器中关闭DOH(安全DNS),而ECH又是需要在浏览器中开启DOH的。

http代理模式虽然能开启DOH,但是依旧会导致ECH失效。

只有使用TAP模式通过虚拟配适器才能在浏览器中继续使用DOH并开启ECH。

ECH测试网站: https://tls-ech.dev/ https://defo.ie/ech-check.php

Possible Solution

Clash自己的DNS设置就可以选择是否用ECH的方式访问对应的DNS服务器。

fuchanghao avatar Sep 07 '22 06:09 fuchanghao

目前 golang 并不支持 ECH, 所以目前没法支持。

cloudflare 目前维护了一个 go 的 fork (https://github.com/cloudflare/go ),看起来包含 ECH 的内容,但毕竟它只是一个 fork, clash 并不会使用它。

Dreamacro avatar Sep 07 '22 10:09 Dreamacro