Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions test/parallel/test-tls-close-notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,18 @@ const server = tls.createServer({
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
}, function(c) {
// Send close-notify without shutting down TCP socket
const req = new ShutdownWrap();
req.oncomplete = common.mustCall(() => {});
req.handle = c._handle;
c._handle.shutdown(req);
// Ensure that we receive 'end' event anyway.
c.on('end', common.mustCall(function() {
server.close();
}));
}).listen(0, common.mustCall(function() {
const c = tls.connect(this.address().port, {
rejectUnauthorized: false
}, common.mustCall(function() {
// Ensure that we receive 'end' event anyway
c.on('end', common.mustCall(function() {
c.destroy();
server.close();
}));
// Send close-notify without shutting down TCP socket.
const req = new ShutdownWrap();
req.oncomplete = common.mustCall(() => {});
req.handle = c._handle;
c._handle.shutdown(req);
}));
}));