Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 81dc241

Browse filesBrowse files
cjihrigMylesBorins
authored andcommitted
tls: prevent multiple connection errors
onConnectEnd(), which is called by TLSSocket, has a guard to prevent being called multiple times, but it does not prevent the OpenSSL error handler from being called, leading to multiple error events. This commit adds that piece of missing logic. PR-URL: #23636 Fixes: #23631 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3ca41dc commit 81dc241
Copy full SHA for 81dc241

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎lib/_tls_wrap.js‎

Copy file name to clipboardExpand all lines: lib/_tls_wrap.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,11 @@ function onocspresponse(resp) {
250250
function onerror(err) {
251251
const owner = this[owner_symbol];
252252

253-
if (owner._writableState.errorEmitted)
253+
if (owner._hadError)
254254
return;
255255

256+
owner._hadError = true;
257+
256258
// Destroy socket if error happened before handshake's finish
257259
if (!owner._secureEstablished) {
258260
// When handshake fails control is not yet released,
@@ -267,8 +269,6 @@ function onerror(err) {
267269
// Throw error
268270
owner._emitTLSError(err);
269271
}
270-
271-
owner._writableState.errorEmitted = true;
272272
}
273273

274274
function initRead(tls, wrapped) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.