diff --git a/src/node_crypto.cc b/src/node_crypto.cc index ce1be1e83ac092..6dc7aa2a73e1d8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1375,13 +1375,11 @@ void SSLWrap::AddMethods(Environment* env, Local t) { env->SetProtoMethod(t, "setSession", SetSession); env->SetProtoMethod(t, "loadSession", LoadSession); env->SetProtoMethodNoSideEffect(t, "isSessionReused", IsSessionReused); - env->SetProtoMethodNoSideEffect(t, "isInitFinished", IsInitFinished); env->SetProtoMethodNoSideEffect(t, "verifyError", VerifyError); env->SetProtoMethodNoSideEffect(t, "getCurrentCipher", GetCurrentCipher); env->SetProtoMethod(t, "endParser", EndParser); env->SetProtoMethod(t, "certCbDone", CertCbDone); env->SetProtoMethod(t, "renegotiate", Renegotiate); - env->SetProtoMethod(t, "shutdownSSL", Shutdown); env->SetProtoMethodNoSideEffect(t, "getTLSTicket", GetTLSTicket); env->SetProtoMethod(t, "newSessionDone", NewSessionDone); env->SetProtoMethod(t, "setOCSPResponse", SetOCSPResponse); @@ -1987,16 +1985,6 @@ void SSLWrap::Renegotiate(const FunctionCallbackInfo& args) { } -template -void SSLWrap::Shutdown(const FunctionCallbackInfo& args) { - Base* w; - ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); - - int rv = SSL_shutdown(w->ssl_.get()); - args.GetReturnValue().Set(rv); -} - - template void SSLWrap::GetTLSTicket(const FunctionCallbackInfo& args) { Base* w; @@ -2130,15 +2118,6 @@ void SSLWrap::SetMaxSendFragment( #endif // SSL_set_max_send_fragment -template -void SSLWrap::IsInitFinished(const FunctionCallbackInfo& args) { - Base* w; - ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); - bool yes = SSL_is_init_finished(w->ssl_.get()); - args.GetReturnValue().Set(yes); -} - - template void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { Base* w; diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index 5ce7145540562d..75b35c5f3c5b3c 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -27,14 +27,17 @@ if (!common.hasCrypto) const tls = require('tls'); const fixtures = require('../common/fixtures'); +const { ShutdownWrap } = process.binding('stream_wrap'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem') }, function(c) { // Send close-notify without shutting down TCP socket - if (c._handle.shutdownSSL() !== 1) - c._handle.shutdownSSL(); + const req = new ShutdownWrap(); + req.oncomplete = common.mustCall(() => {}); + req.handle = c._handle; + c._handle.shutdown(req); }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { rejectUnauthorized: false