Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

TLS error thrown to global scope - CleartextStream error event unhandled #6179

@mmalecki

Description

@mmalecki

On node v0.10 in some cases (still investigating what actually causes that), CleartextStream emits an error event which isn't handled by SecurePair.

Output from crashing process looks like:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: 140735274828160:error:0906D06C:PEM routines:PEM_read_bio:no start line:../deps/openssl/openssl/crypto/pem/pem_lib.c:703:Expecting: CERTIFICATE

    at SlabBuffer.use (tls.js:232:18)
    at CleartextStream.read [as _read] (tls.js:450:29)
    at CleartextStream.Readable.read (_stream_readable.js:320:10)
    at tls.js:514:14
    at process._tickCallback (node.js:415:13)

I can catch this error by setting up an error event handler on CleartextStream in SecurePair.

The same code cause didn't cause any issues on node v0.8. I didn't manage to distill a test yet.

/cc @Southern

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions