test: fix tls-client-reject after ba7c9ce96
This commit is contained in:
parent
c4def505cb
commit
21fbbd5790
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user