diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index d3e5cd1327..d128d08099 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -169,7 +169,7 @@ This class is a subclass of `net.Server` and has the same methods on it. Instead of accepting just raw TCP connections, this accepts encrypted connections using TLS or SSL. -### Event: 'clientError' +### Event: 'tlsClientError' `function (exception, tlsSocket) { }` diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 68bacd8c04..d3df48a4c5 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -809,14 +809,14 @@ function Server(/* [options], listener */) { errorEmitted = true; var connReset = new Error('socket hang up'); connReset.code = 'ECONNRESET'; - self.emit('clientError', connReset, socket); + self.emit('tlsClientError', connReset, socket); } }); socket.on('_tlsError', function(err) { if (!socket._controlReleased && !errorEmitted) { errorEmitted = true; - self.emit('clientError', err, socket); + self.emit('tlsClientError', err, socket); } }); }); diff --git a/test/parallel/test-tls-econnreset.js b/test/parallel/test-tls-econnreset.js index 6ef629a159..78cfbaddb3 100644 --- a/test/parallel/test-tls-econnreset.js +++ b/test/parallel/test-tls-econnreset.js @@ -48,7 +48,7 @@ var connectError = null; var server = tls.createServer({ ca: ca, cert: cert, key: key }, function(conn) { throw 'unreachable'; -}).on('clientError', function(err, conn) { +}).on('tlsClientError', function(err, conn) { assert(!clientError && conn); clientError = err; }).listen(common.PORT, function() { diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js index 442fc3b91c..cc30762574 100644 --- a/test/parallel/test-tls-no-sslv3.js +++ b/test/parallel/test-tls-no-sslv3.js @@ -48,7 +48,7 @@ server.listen(common.PORT, '127.0.0.1', function() { })); }); -server.on('clientError', err => errors.push(err)); +server.on('tlsClientError', err => errors.push(err)); process.on('exit', function() { if (/unknown option -ssl3/.test(stderr)) { diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index 84b2f50615..cbd46c46fe 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -110,7 +110,7 @@ var server = tls.createServer(serverOptions, function(c) { serverResults.push({ sni: c.servername, authorized: c.authorized }); }); -server.on('clientError', function(err) { +server.on('tlsClientError', function(err) { serverResults.push(null); serverError = err.message; }); diff --git a/test/parallel/test-tls-timeout-server.js b/test/parallel/test-tls-timeout-server.js index e3ed246386..036d480b5e 100644 --- a/test/parallel/test-tls-timeout-server.js +++ b/test/parallel/test-tls-timeout-server.js @@ -25,7 +25,7 @@ var options = { var server = tls.createServer(options, common.fail); -server.on('clientError', function(err, conn) { +server.on('tlsClientError', function(err, conn) { conn.destroy(); server.close(); clientErrors++;