resetAndDestroy can not be called on tlssocket?
Open
Nobody has claimed this yet.
confirmed-bug
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example on Node.js 18, then inspect net.Socket.resetAndDestroy and the TLSSocket path shown in the stack trace. Determine whether resetAndDestroy should support TLS sockets or whether the expected behavior needs documenting; completion requires an agreed behavior and corresponding validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100