Skip to content

TLS: improve compliance with shutdown standard, remove hacks

RFC 5246 section-7.2.1 requires that the implementation must immediately stop using the stream, as it is no longer TLS-encrypted. The stream is permitted to still pump events (and errors) to other users, but those are now unencrypted, so we should not process them here. But therefore, we do not want to stop the underlying stream, as there could be another user of it, but we do remove ourselves as a listener.

The section also states that the application must destroy the stream immediately (discarding any pending writes, and sending a close_notify response back), but we leave that to the upper layer of the application here, as it should be sufficient to permit standards compliant usage just to be ignoring read events.

EDIT: In August 2018, TLS v1.3 changed that requirement, per https://tools.ietf.org/html/rfc8446#section-6.1

Does not address new feature https://github.com/nodejs/node/issues/35904 Closes: https://github.com/nodejs/node/pull/35946 Co-authored-by: Momtchil Momtchev momtchil@momtchev.com @mmomtchev CI with https://github.com/libuv/libuv/pull/3036: https://ci.nodejs.org/view/libuv/job/libuv-in-node/171/ (the libuv PR shouldn't be needed to pass CI, but instead should make it even harder to pass tests)

Merge request reports

Loading