diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index b572c90aa50037..1f185dd715802c 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -1724,26 +1724,31 @@ void SSLWrap::OnClientHello(void* arg,
Base* w = static_cast(arg);
Environment* env = w->ssl_env();
HandleScope handle_scope(env->isolate());
- Context::Scope context_scope(env->context());
+ Local context = env->context();
+ Context::Scope context_scope(context);
Local