summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2014-10-06 16:23:01 +0400
committerFedor Indutny <fedor@indutny.com>2014-10-08 15:32:55 +0400
commita2a3fd48934f36d94575dd33d2a2cb732f937f77 (patch)
tree0389cd4c00c6377cf8525214c92479d584932901
parent6462519d3cb7c34671dddb3cedd8441699574f35 (diff)
downloadnode-a2a3fd48934f36d94575dd33d2a2cb732f937f77.tar.gz
tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was shutdown and there could not be any reads. Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/joyent/node/pull/8519
-rw-r--r--src/tls_wrap.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 84bc87e0c..ac05c8eca 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -447,6 +447,10 @@ void TLSCallbacks::ClearOut() {
if (!hello_parser_.IsEnded())
return;
+ // No reads after EOF
+ if (eof_)
+ return;
+
HandleScope handle_scope(env()->isolate());
Context::Scope context_scope(env()->context());
@@ -476,6 +480,10 @@ void TLSCallbacks::ClearOut() {
int err;
Local<Value> arg = GetSSLError(read, &err, NULL);
+ // Ignore ZERO_RETURN after EOF, it is basically not a error
+ if (err == SSL_ERROR_ZERO_RETURN && eof_)
+ return;
+
if (!arg.IsEmpty()) {
// When TLS Alert are stored in wbio,
// it should be flushed to socket before destroyed.