mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
fix: bad assumption about tls in server tests (#915)
This commit fixes a bad assumption that `connectTls` will throw on a handshaking error. Really the TLS conn will only fail on first read or write.
This commit is contained in:
parent
1b4eff019b
commit
db348ae388
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -13,7 +13,8 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
deno: [stable, canary]
|
||||
# TODO(lucacasonato): reenable stable after 1.10 release
|
||||
deno: [canary] # [stable, canary]
|
||||
os: [macOS-latest, ubuntu-latest, windows-2019]
|
||||
|
||||
steps:
|
||||
|
@ -720,17 +720,18 @@ Deno.test({
|
||||
const p = iteratorReq(server);
|
||||
|
||||
try {
|
||||
// Invalid certificate, connection should throw
|
||||
// Invalid certificate, connection should throw on first read or write
|
||||
// but should not crash the server
|
||||
assertThrowsAsync(
|
||||
() =>
|
||||
Deno.connectTls({
|
||||
hostname: "localhost",
|
||||
port,
|
||||
// certFile
|
||||
}),
|
||||
const badConn = await Deno.connectTls({
|
||||
hostname: "localhost",
|
||||
port,
|
||||
// certFile
|
||||
});
|
||||
await assertThrowsAsync(
|
||||
() => badConn.read(new Uint8Array(1)),
|
||||
Deno.errors.InvalidData,
|
||||
);
|
||||
badConn.close();
|
||||
|
||||
// Valid request after invalid
|
||||
const conn = await Deno.connectTls({
|
||||
|
Loading…
Reference in New Issue
Block a user