tls: initialize session and SNI before connecting · nodejs/node@0f0892e · GitHub
Skip to content

Commit 0f0892e

Browse files
styfleaduh95
authored andcommitted
tls: initialize session and SNI before connecting
A synchronous custom lookup can abort the socket before tls.connect() applies the session and SNI, leaving the TLS handle unavailable. Initialize both before starting the connection so the original socket error is emitted normally. Assisted-by: Codex Signed-off-by: Steven <steven@ceriously.com> PR-URL: #65624 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7202aa5 commit 0f0892e

2 files changed

Lines changed: 28 additions & 7 deletions

File tree

‎lib/internal/tls/wrap.js‎

Lines changed: 6 additions & 7 deletions
Lines changed: 22 additions & 0 deletions

0 commit comments

Comments
 (0)