nodejs / nodejs/node

resetAndDestroy can not be called on tlssocket?

未关闭
#49,484 5 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

confirmed-bug
主要语言
JavaScript
星标
122k
派生
37.3k
平均合并
4 天 2 小时
30 天内合并 PR
283

描述

Details

Isn't tlssocket kind of TCP? How to send RST on a tls connection?

Node.js version

18

Example code
const tlssocket = require('tls').connect({
    port: 443,
    host: 'www.example.com',
})
.on('secureConnect', () => {
    tlssocket.resetAndDestroy();
});
TypeError [ERR_INVALID_HANDLE_TYPE]: This handle type cannot be sent
    at new NodeError (node:internal/errors:393:5)
    at Socket.resetAndDestroy (node:net:700:13)
    at TLSSocket.<anonymous> (/path/to/test.js)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket.onConnectSecure (node:_tls_wrap:1576:10)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:952:8)
    at ssl.onhandshakedone (node:_tls_wrap:733:12)
Operating system

Not applicable.

Scope

runtime

Module and version

net tls

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

在 Node.js 18 上复现该示例,然后检查 net.Socket.resetAndDestroy 以及堆栈跟踪中显示的 TLSSocket 路径。确定 resetAndDestroy 是否应支持 TLS 套接字,或者是否需要记录预期行为;完成这项工作需要确定一致的行为并进行相应的验证。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
networking
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
32/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。