Skip to content

TLSSocket._tlsOptions undefined during TLSWrap.onerror cause an additional TypeError #41501

@sigv

Description

@sigv

Version

v16.13.2

Platform

Linux example.com 5.11.0-1025-azure #27~20.04.1-Ubuntu SMP Fri Jan 7 15:02:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

There is no clean repro case to provide. We are seeing what we believed to be a connection abort/reset issue caused by local router configuration. Something in our setup causes the TLSWrap.onerror to be called where owner has undefined _tlsOptions, potentially that TLS negotiation fails. /lib/_tls_wrap.js L411 is relevant, as visible in log below.

How often does it reproduce? Is there a required condition?

See above; conditions are not fully understood.

What is the expected behavior?

We expect to see a networking error, that informs up what exactly went wrong.
(Instead of it being suppressed by a TypeError.)

What do you see instead?

TypeError: Cannot read properties of undefined (reading 'isServer')
    at TLSWrap.onerror (node:_tls_wrap:411:27)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
  domainThrown: true
}

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    tlsIssues and PRs related to the tls subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions