fix(grok): 禁用 HTTP/2 协商以适配 axios
axios 底层仅支持 HTTP/1.1,强制协商 h2 会导致服务端返回的 H2 帧解析失败。将 ALPN 协议列表修改为仅 'http/1.1' 以确保连接兼容性。
This commit is contained in:
parent
73079dc4ee
commit
89e80148d0
1 changed files with 3 additions and 2 deletions
|
|
@ -64,8 +64,9 @@ const httpsAgent = new https.Agent({
|
||||||
sigalgs: CHROME_SIGALGS,
|
sigalgs: CHROME_SIGALGS,
|
||||||
minVersion: 'TLSv1.2',
|
minVersion: 'TLSv1.2',
|
||||||
maxVersion: 'TLSv1.3',
|
maxVersion: 'TLSv1.3',
|
||||||
// Chrome 的 ALPN 协商顺序: h2 优先
|
// axios 仅支持 HTTP/1.1,不能协商 h2(否则服务端返回 H2 帧会解析失败)
|
||||||
ALPNProtocols: ['h2', 'http/1.1'],
|
// 注意:真实 Chrome 会协商 h2,但 Node.js http 模块不支持
|
||||||
|
ALPNProtocols: ['http/1.1'],
|
||||||
// Chrome 支持的 EC 曲线
|
// Chrome 支持的 EC 曲线
|
||||||
ecdhCurve: 'X25519:P-256:P-384',
|
ecdhCurve: 'X25519:P-256:P-384',
|
||||||
// 允许不安全的旧版协商 (Chrome 也允许)
|
// 允许不安全的旧版协商 (Chrome 也允许)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue