summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/http_test.ts12
-rw-r--r--cli/tests/unit/tls_test.ts28
2 files changed, 20 insertions, 20 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index bd4c8da09..acdaef903 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -326,8 +326,8 @@ Deno.test(
const listener = Deno.listenTls({
hostname,
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.crt"),
+ key: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.key"),
});
const conn = await listener.accept();
const httpConn = Deno.serveHttp(conn);
@@ -2294,8 +2294,8 @@ Deno.test(
const listener = Deno.listenTls({
hostname,
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
});
const caCerts = [
@@ -2600,8 +2600,8 @@ for (const compression of [true, false]) {
const listener = Deno.listenTls({
hostname,
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
alpnProtocols: ["h2"],
});
const server = httpServerWithErrorBody(listener, compression);
diff --git a/cli/tests/unit/tls_test.ts b/cli/tests/unit/tls_test.ts
index 8ab41b81a..2e797b160 100644
--- a/cli/tests/unit/tls_test.ts
+++ b/cli/tests/unit/tls_test.ts
@@ -183,8 +183,8 @@ Deno.test(
const listener = Deno.listenTls({
hostname,
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
});
const response = encoder.encode(
@@ -296,8 +296,8 @@ async function tlsPair(): Promise<[Deno.Conn, Deno.Conn]> {
const listener = Deno.listenTls({
hostname: "localhost",
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
});
const acceptPromise = listener.accept();
@@ -320,8 +320,8 @@ async function tlsAlpn(
const listener = Deno.listenTls({
hostname: "localhost",
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
alpnProtocols: ["deno", "rocks"],
});
@@ -725,8 +725,8 @@ async function tlsWithTcpFailureTestImpl(
const tlsListener = Deno.listenTls({
hostname: "localhost",
port: tlsPort,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
});
const tcpPort = getPort();
@@ -1019,8 +1019,8 @@ function createHttpsListener(port: number): Deno.Listener {
const listener = Deno.listenTls({
hostname: "localhost",
port,
- certFile: "./cli/tests/testdata/tls/localhost.crt",
- keyFile: "./cli/tests/testdata/tls/localhost.key",
+ cert: Deno.readTextFileSync("./cli/tests/testdata/tls/localhost.crt"),
+ key: Deno.readTextFileSync("./cli/tests/testdata/tls/localhost.key"),
});
serve(listener);
@@ -1285,8 +1285,8 @@ Deno.test(
const listener = Deno.listenTls({
hostname,
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: await Deno.readTextFile("cli/tests/testdata/tls/localhost.crt"),
+ key: await Deno.readTextFile("cli/tests/testdata/tls/localhost.key"),
});
const acceptPromise = listener.accept();
const connectPromise = Deno.connectTls({
@@ -1354,8 +1354,8 @@ Deno.test(
const listener = Deno.listenTls({
hostname,
port,
- certFile: "cli/tests/testdata/tls/localhost.crt",
- keyFile: "cli/tests/testdata/tls/localhost.key",
+ cert: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.crt"),
+ key: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.key"),
});
for await (const conn of listener) {
for (let i = 0; i < 10; i++) {