Prepare verified laboratory 7 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 20afc2c790
commit eb1b5c7b84
677 changed files with 208256 additions and 64 deletions
+45
View File
@@ -0,0 +1,45 @@
import { test, expect } from "bun:test";
import { expectDenied } from "./transport";
test("native explicit revoked-certificate alert is client denial, while an application success is not", async () => {
expect(
await expectDenied(
() =>
Promise.reject(
Object.assign(new Error("synthetic revoked certificate"), {
code: "ERR_SSL_SSLV3_ALERT_CERTIFICATE_REVOKED",
}),
),
"client",
),
).toBe("ERR_SSL_SSLV3_ALERT_CERTIFICATE_REVOKED");
await expect(
expectDenied(
async () => ({
data: "HTTP/1.1 200 OK",
authorized: true,
protocol: "TLSv1.3",
}),
"client",
),
).rejects.toThrow("NEGATIVE_FAILED_FOR_UNEXPECTED_REASON");
});
test("Bun native certificate-required alert counts as client denial while timeout never does", async () => {
const certificate = () =>
Promise.reject(
Object.assign(new Error("synthetic native certificate alert"), {
code: "ERR_SSL_TLSV1_ALERT_CERTIFICATE_REQUIRED",
}),
);
expect(await expectDenied(certificate, "client")).toBe(
"ERR_SSL_TLSV1_ALERT_CERTIFICATE_REQUIRED",
);
await expect(
expectDenied(
() =>
Promise.reject(
Object.assign(new Error("synthetic timeout"), { code: "ETIMEDOUT" }),
),
"client",
),
).rejects.toThrow("NEGATIVE_FAILED_FOR_UNEXPECTED_REASON");
});