Skip to content

Commit

Permalink
test: end tls gracefully, rather than destroy
Browse files Browse the repository at this point in the history
The timing of destroy between client/server is undefined, but end is
guaranteed to occur.

PR-URL: #25508
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
sam-github authored and addaleax committed Feb 8, 2019
1 parent 7e9f5ea commit ef9139e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-tls-sni-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ let clientError;

const server = tls.createServer(serverOptions, function(c) {
serverResults.push({ sni: c.servername, authorized: c.authorized });
c.end();
});

server.on('tlsClientError', function(err) {
Expand All @@ -135,7 +136,6 @@ function startTest() {
clientResults.push(
client.authorizationError &&
(client.authorizationError === 'ERR_TLS_CERT_ALTNAME_INVALID'));
client.destroy();

next();
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-sni-server-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const clientResults = [];

const server = tls.createServer(serverOptions, function(c) {
serverResults.push(c.servername);
c.end();
});

server.addContext('a.example.com', SNIContexts['a.example.com']);
Expand All @@ -107,7 +108,6 @@ function startTest() {
clientResults.push(
client.authorizationError &&
(client.authorizationError === 'ERR_TLS_CERT_ALTNAME_INVALID'));
client.destroy();

// Continue
start();
Expand Down

0 comments on commit ef9139e

Please sign in to comment.