Skip to content

resetAndDestroy can not be called on tlssocket? #49484

Description

@LongTengDao

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions