From 21fbbd579080bab569c66100471a4c7b462bb0d6 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 31 Oct 2013 23:39:43 +0400 Subject: [PATCH] test: fix tls-client-reject after ba7c9ce96 --- test/simple/test-tls-client-reject.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/simple/test-tls-client-reject.js b/test/simple/test-tls-client-reject.js index 410096f..bae9614 100644 --- a/test/simple/test-tls-client-reject.js +++ b/test/simple/test-tls-client-reject.js @@ -50,6 +50,7 @@ var server = tls.createServer(options, function(socket) { function unauthorized() { var socket = tls.connect({ port: common.PORT, + servername: 'localhost', rejectUnauthorized: false }, function() { assert(!socket.authorized); @@ -63,7 +64,9 @@ function unauthorized() { } function rejectUnauthorized() { - var socket = tls.connect(common.PORT, function() { + var socket = tls.connect(common.PORT, { + servername: 'localhost' + }, function() { assert(false); }); socket.on('error', function(err) { @@ -75,7 +78,8 @@ function rejectUnauthorized() { function authorized() { var socket = tls.connect(common.PORT, { - ca: [fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))] + ca: [fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))], + servername: 'localhost' }, function() { assert(socket.authorized); socket.end(); -- 2.7.4