v2ray-core icon indicating copy to clipboard operation
v2ray-core copied to clipboard

建议添加ESNI支持

Open Lostsite opened this issue 5 years ago • 10 comments

理论上这应该是客户端的功能,但是V2Ray不分客户端和服务器端。

在TLS1.3中,正式支持了ESNI,同时windows即将支持DoH,那么就表明,隐藏目标域名即将变得可能。

尽管目前GFW似乎会阻断大部分的ESNI链接,但是越来越多的网站开始支持ESNI,GFW今后不可能完全阻断ESNI握手,在这种情况下,支持ESNI握手以防止域名被墙变得可能(特别是目前大部分服务商开始封堵域名前置过后,这一项工作变得越来越重要)。

Theoretically, this should be a client-side feature, but V2Ray - core have the same code for the client and server.

In TLS 1.3, ESNI is officially been supported, and windows is going to support DoH, so it's going to be possible for us to hide the domain we are going to visit.

For now, it seems like the GFW will block almost all the TLS handshakes which enabled ESNI. However, more and more websites are moving towards to TLS 1.3, and enables ESNI, as the result, I believe in the furture the GFW could not block all the ESNI handshakes. In this case, enable ESNI could help our domain would not be fully blocked by the GFW. (especially since most service providers are now starting to block domain fronting, which means ESNI handshake become more and more important).

Lostsite avatar Dec 31 '20 17:12 Lostsite

第一,ESNI 已经被 GFW 阻断,这是几个月前的旧闻了。 并且 ESNI 已经被淘汰,后续标准 ECH 已经提出。后者目前还没有任何实例上线,ECH 的主要推动者 Cloudflare 都没有。

第二,ESNI/ECH 的目的是让审查者失去通过 TLS 握手包里的 SNI 来阻断特定域名访问的能力。所以使用 ESNI/ECH 的目的就是不通过 v2ray 直接上部分黑名单网站。用户想使用 ESNI,应该去浏览器里设置。你先去弄明白什么浏览器可以启用 ESNI,怎样启用再说。而如果你是想在被 v2ray 代理的连接上使用 ESNI/ECH,那么啥也不用做 v2ray 就已经“支持”,虽然这样用并非设计 ESNI/ECH 的本意。v2ray 又不会管被代理连接是怎么样 TLS 握手的,也管不了。

第三,如果你是指 v2ray 客户端连接 v2ray 服务器时使用 ECH,那也应该向 https://github.com/golang/go 去提需求让他们在 golang TLS 库里支持 ECH,关 v2ray 什么事?

darhwa avatar Jan 01 '21 03:01 darhwa

  1. ESNI目前被阻断,但是以后有可能变为一种通用标准,那样GFW不可能完全阻断。ESNI已经有网站/DNS开始使用,但是ECH目前还没有使用。

  2. 第二点我没有要求V2Ray支持(再说现在ESNI被GFW阻断)

  3. 是的,我是指这一点。我不是开发人员,我不确定golang的TLS库的支持与V2Ray的编译有什么关系,如果Golang不支持ESNI的话,V2Ray就没法实现TLS的ESNI的握手了吗?如果是这样,我本意也是提一个issue,希望能加进后续开发计划。当Golang(或后续切换为别的底层语言之后)支持ESNI后,将其加入V2Ray,使得GFW在阻断放宽后,可以通过ESNI进行TLS握手,以保护域名。

  4. ESNI is currently been blocked, but it may become a common standard in the future, so that GFW can not completely block all the websites enabled ESNI. And ESNI has already been used by some websites/DNS, but ECH hasn't been supported yet.

  5. the second point you said I did not ask for V2Ray to support (and again now ESNI is blocked by GFW)

  6. Yes, I was referring to this point. I'm not a developer, and I'm not sure what Golang's TLS library support has to do with V2Ray's. If Golang doesn't support ESNI, will V2Ray not be able to implement the handshake for TLS over ESNI? If so, just want to bring out an issue, and hopefully, the developers could add it to the upcoming development plan. When Golang (or after the subsequent switch to another underlying language) supports ESNI, to add it into V2Ray, making it possible after GFW allows the TLS handshake via ESNI to protect the domain.

Lostsite avatar Jan 01 '21 17:01 Lostsite

现阶段这对于V2RAY来说这基本上毫无意义. 1.由于你使用的域名只用来翻墙没有敏感站点,GFW不会墙掉你的域名.如果你把VMESS放在TLS+WS之后,GFW都无法知道V2RAY的存在. 2.你在V2RAY的ISSUE发了一个"添加ESNI支持"的帖子,然后又说"我没有要求V2Ray支持",这不矛盾么? 3.如果Golang的TLS库不提供支持,V2RAY自然也不会支持.这是模块化的特性,程序员也不会为了某一个功能破坏整个特性. 4.除非有急迫的需求,没有人会去自己修改现有公开库.否则本身一个引用的工作量,会变成引用+对库的维护工作,还很有可能引入不可知的问题.很明显,我在V2RAY上没有看到这种急迫性. 5.如果你自己有这样的特殊需求,你可以让两个前端对接,V2RAY放到这两个前端后.当然,因为GFW已经封锁了全部的ESNI,你会被墙掉.

wwbfred avatar Jan 02 '21 07:01 wwbfred

通过非加密dns协商esni是毫无意义的,因为最终还是会通过域名解析的过程暴露一个人正在访问什么域名。其次esni还处在草案阶段,总体上并没有形成一个正式的标准,而且上游的golang也不支持,因此要做真的很难。 即便是golang和v2ray-core最终支持了,那对于一些采用tls+websocket的用户来说,nginx等web服务器不支持那也是无法使用的。

题外话:浏览器是如何协商esni的? 在一个支持该特性的浏览器中尝试访问支持esni的网站时,浏览器将通过以下流程加载网站: 1.当用户输入一个域名后,浏览器向 DNS 服务器发送查询,以查询网站的 IP 地址和公钥(火狐浏览器默认查询 _esni 子域名的txt记录,例如 nslookup -type=txt _esni.cloudflare.com 就可以查询到cloudflare网站的公钥) 2.DNS 服务器告诉浏览器网站的IP和公钥。 3.浏览器向指定的 IP 地址发送Client Hello,并使用获得到的公钥对Client Hello的 SNI 部分进行加密。 4.TLS协商过程。 5.TLS 连接继续进行,此时用户将能在浏览器中看到所访问的网站页面。

ghost avatar Jan 02 '21 12:01 ghost

刚用这个项目,提交了一个issue,并浏览了前几个issues,个人建议楼主这类标题可以改成 “建议添加ESNI支持”,除非本身是开发者,并已知现有库和代码可行的情况下有明显迫切需求,描述过程,否则话题应该在讨论区出现,不然会浪费项目维护/开发者大量时间。 p.s 我看了这里很多issue都是中文,楼主英文自翻译中太多介词,语法也有问题,有中文就好了。 anyway,我只是路过,刚发了一个issue,挺好的这个项目。

nov30th avatar Jan 02 '21 14:01 nov30th

  1. 似乎有记录在使用域名伪装过后,因为大量非正常流量导致域名被墙事件,而ESNI可以避免这一点。
  2. 我是指,希望这可以被加进后续开发计划,而不是立即的类似于BUG修复级的更新。
  3. Windows即将支持DOH,而其他大部分系统已经支持DOH。
  4. 目前Cloudflare DNS支持ESNI握手,Firefox也已经支持。

Lostsite avatar Jan 03 '21 09:01 Lostsite

Any updates on this? Is ESNI still blocked by GFW or Iran's firewall?

parsanoori avatar Mar 08 '23 21:03 parsanoori

ESNI, which only protects SNI, has weaknesses and is going to be supplanted by ECH (Encrypted ClientHello). However, ECH is still in the development stage and has not yet seen widespread use, apart from a few experiments. And according to cloudflare

ECH is not yet widely available for web services behind Cloudflare.

Furthermore, go's crypto/tls does not support ECH, yet.

mydogshitgold avatar Mar 09 '23 01:03 mydogshitgold

Thanks

parsanoori avatar Mar 09 '23 16:03 parsanoori

CloudFlare 已经启用 ECH Encrypted Client Hello - the last puzzle piece to privacy

Today we are excited to announce a contribution to improving privacy for everyone on the Internet. Encrypted Client Hello, a new proposed standard that prevents networks from snooping on which websites a user is visiting, is now available on all Cloudflare plans.

We've enabled ECH for all free zones already.

LynneHamai avatar Oct 05 '23 04:10 LynneHamai