aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-wrap-econnreset-pipe.js
diff options
context:
space:
mode:
authorJosé F. Romaniello <jfromaniello@gmail.com>2016-06-29 10:29:19 -0300
committerTobias Nießen <tniessen@tnie.de>2017-06-14 21:18:24 +0200
commit3ee37329da7323a86c248a63fe20d40885c7a84a (patch)
tree6f2c092e43c89929020b8d12eced1322f6a0d9a5 /test/parallel/test-tls-wrap-econnreset-pipe.js
parentc1c226719f269f013f000e8ad9194254e6d83f51 (diff)
downloadandroid-node-v8-3ee37329da7323a86c248a63fe20d40885c7a84a.tar.gz
android-node-v8-3ee37329da7323a86c248a63fe20d40885c7a84a.tar.bz2
android-node-v8-3ee37329da7323a86c248a63fe20d40885c7a84a.zip
tls: add host and port info to ECONNRESET errors
Add more information to the "ECONNRESET" errors generated when the socket hang ups before establishing the secure connection. These kind of errors are really hard to troubleshoot without this info. PR-URL: https://github.com/nodejs/node/pull/7476 Reviewed-By: Trevor Norris <trevnorris@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Yazhong Liu <yorkiefixer@gmail.com>
Diffstat (limited to 'test/parallel/test-tls-wrap-econnreset-pipe.js')
-rw-r--r--test/parallel/test-tls-wrap-econnreset-pipe.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/parallel/test-tls-wrap-econnreset-pipe.js b/test/parallel/test-tls-wrap-econnreset-pipe.js
new file mode 100644
index 0000000000..5925d65658
--- /dev/null
+++ b/test/parallel/test-tls-wrap-econnreset-pipe.js
@@ -0,0 +1,22 @@
+'use strict';
+
+const common = require('../common');
+const assert = require('assert');
+const tls = require('tls');
+const net = require('net');
+
+common.refreshTmpDir();
+
+const server = net.createServer((c) => {
+ c.end();
+}).listen(common.PIPE, common.mustCall(() => {
+ tls.connect({ path: common.PIPE })
+ .once('error', common.mustCall((e) => {
+ assert.strictEqual(e.code, 'ECONNRESET');
+ assert.strictEqual(e.path, common.PIPE);
+ assert.strictEqual(e.port, undefined);
+ assert.strictEqual(e.host, undefined);
+ assert.strictEqual(e.localAddress, undefined);
+ server.close();
+ }));
+}));