summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMir Mufaqam Ali <mannanali413@gmail.com>2017-12-20 17:28:03 +0530
committerJoyee Cheung <joyeec9h3@gmail.com>2017-12-24 00:03:39 +0800
commit79261f3003719264bc03f6a5b54cf9eddbc8b48e (patch)
tree15825a4173ea27e4bb17e9bfb17fa9a061c81848 /lib
parent0b7889582428b3cf1ea0ee48768854a2ca63478c (diff)
downloadandroid-node-v8-79261f3003719264bc03f6a5b54cf9eddbc8b48e.tar.gz
android-node-v8-79261f3003719264bc03f6a5b54cf9eddbc8b48e.tar.bz2
android-node-v8-79261f3003719264bc03f6a5b54cf9eddbc8b48e.zip
tls: migrate errors in _tls_wrap.js
This migrates the old style error in _tls_wrap.js to the new style error ERR_TLS_RENEGOTIATION_DISABLED. Refs: https://github.com/nodejs/node/issues/17709 PR-URL: https://github.com/nodejs/node/pull/17792 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_tls_wrap.js3
-rw-r--r--lib/internal/errors.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index e30efa4159..07d7cb7298 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -70,8 +70,7 @@ function onhandshakestart() {
}
if (owner[kDisableRenegotiation] && this.handshakes > 0) {
- const err = new Error('TLS session renegotiation disabled for this socket');
- owner._emitTLSError(err);
+ owner._emitTLSError(new errors.Error('ERR_TLS_RENEGOTIATION_DISABLED'));
}
}
diff --git a/lib/internal/errors.js b/lib/internal/errors.js
index 779343e066..abb999499c 100644
--- a/lib/internal/errors.js
+++ b/lib/internal/errors.js
@@ -474,6 +474,8 @@ E('ERR_TLS_CERT_ALTNAME_INVALID',
'Hostname/IP does not match certificate\'s altnames: %s');
E('ERR_TLS_DH_PARAM_SIZE', 'DH parameter size %s is less than 2048');
E('ERR_TLS_HANDSHAKE_TIMEOUT', 'TLS handshake timeout');
+E('ERR_TLS_RENEGOTIATION_DISABLED',
+ 'TLS session renegotiation disabled for this socket');
E('ERR_TLS_RENEGOTIATION_FAILED', 'Failed to renegotiate');
E('ERR_TLS_REQUIRED_SERVER_NAME',
'"servername" is required parameter for Server.addContext');