diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index d876638c6151b8..14602eb56960aa 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -347,14 +347,15 @@ Local TLSWrap::GetSSLError(int status, int* err, std::string* msg) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_X509_LOOKUP: - break; + return Local(); + case SSL_ERROR_ZERO_RETURN: return scope.Escape(env()->zero_return_string()); - break; - default: - { - CHECK(*err == SSL_ERROR_SSL || *err == SSL_ERROR_SYSCALL); + case SSL_ERROR_SSL: + case SSL_ERROR_SYSCALL: + { + unsigned long ssl_err = ERR_peek_error(); // NOLINT(runtime/int) BIO* bio = BIO_new(BIO_s_mem()); ERR_print_errors(bio); @@ -372,8 +373,11 @@ Local TLSWrap::GetSSLError(int status, int* err, std::string* msg) { return scope.Escape(exception); } + + default: + UNREACHABLE(); } - return Local(); + UNREACHABLE(); }