From b251e5c6ba028211368f1a8d58e017c3dc85938c Mon Sep 17 00:00:00 2001 From: xortiz Date: Sun, 17 Dec 2017 17:08:17 -0500 Subject: [PATCH] I believe I Migrated error the error. Will check and do any changes if noticed something wrong. --- lib/_tls_legacy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/_tls_legacy.js b/lib/_tls_legacy.js index d65da58e8cf2e9..4b79c70f9e5f99 100644 --- a/lib/_tls_legacy.js +++ b/lib/_tls_legacy.js @@ -28,6 +28,7 @@ const assert = require('assert'); const { Buffer } = require('buffer'); const common = require('_tls_common'); const { Connection } = process.binding('crypto'); +const errors = require('internal/errors') const EventEmitter = require('events'); const stream = require('stream'); const { Timer } = process.binding('timer_wrap'); @@ -632,7 +633,7 @@ function onhandshakestart() { // state machine and OpenSSL is not re-entrant. We cannot allow the user's // callback to destroy the connection right now, it would crash and burn. setImmediate(function() { - var err = new Error('TLS session renegotiation attack detected'); + const err = new errors.Error('ERR_TLS_SESSION_ATTACK'); if (self.cleartext) self.cleartext.emit('error', err); }); }