diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index bc830dba74dd82..94f70eba5de6cb 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -36,11 +36,11 @@ TLSWrap::TLSWrap(Environment* env, Kind kind, StreamBase* stream, SecureContext* sc) - : SSLWrap(env, sc, kind), - StreamBase(env), - AsyncWrap(env, + : AsyncWrap(env, env->tls_wrap_constructor_function()->NewInstance(), AsyncWrap::PROVIDER_TLSWRAP), + SSLWrap(env, sc, kind), + StreamBase(env), sc_(sc), stream_(stream), enc_in_(nullptr), diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 47cbf27fe288e5..31d19523a62d08 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -21,9 +21,9 @@ namespace crypto { class SecureContext; } -class TLSWrap : public crypto::SSLWrap, - public StreamBase, - public AsyncWrap { +class TLSWrap : public AsyncWrap, + public crypto::SSLWrap, + public StreamBase { public: ~TLSWrap() override;