From 18a235e6088a43411bbeca79bae8bcc646f72104 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 24 Jan 2024 03:35:23 +1100 Subject: refactor: set removal version for `Deno.ListenTlsOptions.certFile`, `Deno.ListenTlsOptions.keyFile` and `Deno.ConnectTlsOptions.certFile` (#22026) This change: 1. Sets the removal version for `Deno.ListenTlsOptions.certFile`, `Deno.ListenTlsOptions.keyFile` and `Deno.ConnectTlsOptions.certFile` for Deno v2, in favour of the `cert`, `key` and `caCerts` options, respectively. 2. Replaces use of the deprecated options with the new recommended options. Towards #22021 --- cli/tests/testdata/cert/listen_tls_alpn.ts | 4 ++-- cli/tests/testdata/cert/listen_tls_alpn_fail.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/tests/testdata/cert') diff --git a/cli/tests/testdata/cert/listen_tls_alpn.ts b/cli/tests/testdata/cert/listen_tls_alpn.ts index b3ade686e..6b92364ba 100644 --- a/cli/tests/testdata/cert/listen_tls_alpn.ts +++ b/cli/tests/testdata/cert/listen_tls_alpn.ts @@ -1,7 +1,7 @@ const listener = Deno.listenTls({ port: Number(Deno.args[0]), - certFile: "./tls/localhost.crt", - keyFile: "./tls/localhost.key", + cert: Deno.readTextFileSync("./tls/localhost.crt"), + key: Deno.readTextFileSync("./tls/localhost.key"), alpnProtocols: ["h2", "http/1.1", "foobar"], }); diff --git a/cli/tests/testdata/cert/listen_tls_alpn_fail.ts b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts index c1aa4b31d..e321c9bd3 100644 --- a/cli/tests/testdata/cert/listen_tls_alpn_fail.ts +++ b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts @@ -2,8 +2,8 @@ import { assertRejects } from "../../../../test_util/std/assert/mod.ts"; const listener = Deno.listenTls({ port: Number(Deno.args[0]), - certFile: "./tls/localhost.crt", - keyFile: "./tls/localhost.key", + cert: Deno.readTextFileSync("./tls/localhost.crt"), + key: Deno.readTextFileSync("./tls/localhost.key"), alpnProtocols: ["h2", "http/1.1", "foobar"], }); -- cgit v1.2.3