fix(tls): throw meaningful error when hostname is invalid (#10387)

`InvalidDNSNameError` is thrown when a string is not a valid hostname,
e.g. it contains invalid characters, or starts with a numeric digit. It
does not involve a (failed) DNS lookup.
This commit is contained in:
Bert Belder 2021-04-26 19:39:55 +00:00
parent 87c055b371
commit 299518d935
4 changed files with 22 additions and 16 deletions

View file

@ -32,7 +32,7 @@ unitTest(
await assertThrowsAsync(async () => {
await Deno.connectTls({ hostname: "127.0.0.1", port: 3567 });
}, Error);
}, TypeError);
listener.close();
},