net,tls: pass a valid socket on the `tlsClientError` event
Fixes: https://github.com/nodejs/node/issues/43963
On the tlsClientError
event, the tls.TLSSocket
instance is passed as 'closed' status.
Thus, users can't get information such as remote address
, remoteFamily
, and so on.
This adds a flag to close a socket after emitting the tlsClientError
event.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com