tls: add support for Encrypted Client Hello (ECH) — tracking (OpenSSL 4.0 / master)
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.3k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
What is the problem this feature will solve?
Node.js has no support for Encrypted Client Hello (ECH). The node:tls module (and everything built on it, including undici/fetch) always sends the SNI in plaintext, so applications cannot make TLS connections with an encrypted ClientHello the way modern browsers (Firefox, Chrome) already do.
There was a previous tracking issue for this, #31618 ("tls: Encrypted Client Hello (ECH)"), but it was auto-closed by the stale bot in Oct 2022 due to inactivity — not because it was implemented. At that time the feature was explicitly blocked on OpenSSL, per the maintainers:
"ESNI is still in draft ... can't be supported by Node.js until OpenSSL supports it."
Status of the upstream dependency
ECH is now standardized as RFC 9849 (March 2026), and OpenSSL's ECH tracking issue openssl/openssl#7482 was closed as completed on 2026-03-04 (merge openssl/openssl#30086). Per the closing comment:
"ECH support for this RFC will be in OpenSSL 4.0 and is already in the master branch."
So the important nuance: ECH is in OpenSSL master, targeting the 4.0 release — it is not in the 3.5 line that Node currently bundles. This request is therefore not immediately actionable; it is a tracking issue for when Node bundles an OpenSSL that includes ECH (4.0+). Filing it now so the requirement is captured, since the old #31618 is stale-closed.
What is the feature you are proposing to solve the problem?
Once Node bundles an OpenSSL with ECH (4.0+), expose that ECH API through node:tls. Concretely:
- A
tls.connect()option to supply the config material, e.g.echConfigList(aBuffercontaining the server'sECHConfigList), mirroring OpenSSL'sSSL_ech_set1_echconfig()/SSL_CTX_ech_set1_echconfig(). - A way to surface the ECH outcome after the handshake (accepted / rejected / retry-config), e.g. via
SSL_ech_get1_status(), so callers can distinguish real ECH from GREASE. - Optionally, resolver integration so the
ECHConfigListfrom aHTTPS/SVCBDNS RR can be used (browsers fetch it from DNS). Could start with a caller-supplied config and add DNS integration later.
Consumers like undici/fetch would then inherit ECH support.
What alternatives have you considered?
- Shelling out to an ECH-enabled
curlbuild — requires a custom curl build and loses the native API. - A native N-API addon calling
SSL_ech_*— Node's bundled OpenSSL (3.5.x) doesn't include ECH, so this needs a rebuilt Node against OpenSSL 4.0/master. - Driving a headless browser — far too heavy and doesn't measure a clean protocol-level request.
None of these are a substitute for first-class support in node:tls.
Related
- Previous (stale-closed) tracking issue: #31618
- Upstream OpenSSL ECH (targeting 4.0 / in master): https://github.com/openssl/openssl/issues/7482
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该 issue 未指定任何 Node.js 源文件或测试;捆绑的依赖项可用后,从 node:tls tls.connect API 和 OpenSSL 4.0 ECH APIs 开始。完成的标准是 Node 暴露约定的调用方提供的 ECH 配置和握手结果,并根据最终范围处理 DNS 集成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nodejs
- 领域
- networking, security
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100