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

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

Closed
mmalecki opened this issue Sep 4, 2013 · 2 comments
Closed
Assignees
Milestone

Comments

@mmalecki
Copy link

mmalecki commented Sep 4, 2013

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

@ghost ghost assigned indutny Sep 4, 2013
@indutny
Copy link
Member

indutny commented Sep 4, 2013

I'll look into it tomorrow.

@indutny
Copy link
Member

indutny commented Sep 9, 2013

Hm... after looking into the code, it seems that it is an expected behaviour.

Cleartext stream is basically a user-facing stream, i.e. the one emitted in secureConnection event and given to you. So its user's responsibility to watch events on it after receiving it.

@indutny indutny closed this as completed Sep 9, 2013
gibfahn added a commit to ibmruntimes/node that referenced this issue Apr 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants