sessionOptions.certificateCompression


  • 类型:<string[]> 'zlib''brotli''zstd'中的一个或多个,按偏好顺序。

启用本会话的 TLS 证书压缩 (RFC 8879)。如果省略,则禁用证书压缩。

🌐 Enables TLS certificate compression (RFC 8879) for this session. When omitted, certificate compression is disabled.

在服务器端,证书链会使用客户端宣称支持的第一个算法进行压缩。在客户端,这些列出的算法会告知服务器,以便服务器可以压缩它的证书。当使用客户端身份验证时,这个选项也会控制客户端证书的压缩。

🌐 On the server side, the certificate chain is compressed using the first listed algorithm that the client advertises support for. On the client side, the listed algorithms are advertised to the server so that the server may compress its certificate. When client authentication is in use, the option also controls compression of the client's certificate.

压缩证书链对 QUIC 特别有用,因为它可以减小服务器第一次发送的数据量,这受到防放大限制的约束(见 证书大小和握手性能)。证书压缩需要 TLS 1.3,而 QUIC 总是使用它。

🌐 Compressing the certificate chain is especially useful for QUIC because it reduces the size of the server's first flight, which is bounded by the anti-amplification limit (see Certificate size and handshake performance). Certificate compression requires TLS 1.3, which QUIC always uses.

最多可以指定三个算法。如果 Node.js 是在缺少证书压缩支持的共享 OpenSSL 上构建的,这个选项会被默默忽略。

🌐 At most three algorithms may be specified. The option is silently ignored if Node.js was built against a shared OpenSSL that lacks certificate compression support.