From 3a243c827238b93c3f09a38e3b5e90e2ccfc15a1 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Mon, 19 Feb 2024 01:26:16 +1100 Subject: BREAKING: add `Deno.CreateHttpClientOptions.{cert,key}` (#22280) This change deprecates `Deno.CreateHttpClientOptions.{certChain,privateKey}` in favour of `Deno.CreateHttpClientOptions.{cert,key}`. Closes #22278 Co-authored-by: Matt Mastracci --- tests/unit/fetch_test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts index dc596718f..c33503bdf 100644 --- a/tests/unit/fetch_test.ts +++ b/tests/unit/fetch_test.ts @@ -1333,8 +1333,8 @@ Deno.test( async function fetchClientCertWrongPrivateKey(): Promise { await assertRejects(async () => { const client = Deno.createHttpClient({ - certChain: "bad data", - privateKey: await Deno.readTextFile( + cert: "bad data", + key: await Deno.readTextFile( "tests/testdata/tls/localhost.key", ), }); @@ -1350,10 +1350,10 @@ Deno.test( async function fetchClientCertBadPrivateKey(): Promise { await assertRejects(async () => { const client = Deno.createHttpClient({ - certChain: await Deno.readTextFile( + cert: await Deno.readTextFile( "tests/testdata/tls/localhost.crt", ), - privateKey: "bad data", + key: "bad data", }); await fetch("https://localhost:5552/assets/fixture.json", { client, @@ -1367,10 +1367,10 @@ Deno.test( async function fetchClientCertNotPrivateKey(): Promise { await assertRejects(async () => { const client = Deno.createHttpClient({ - certChain: await Deno.readTextFile( + cert: await Deno.readTextFile( "tests/testdata/tls/localhost.crt", ), - privateKey: "", + key: "", }); await fetch("https://localhost:5552/assets/fixture.json", { client, @@ -1387,10 +1387,10 @@ Deno.test( const data = "Hello World"; const caCert = await Deno.readTextFile("tests/testdata/tls/RootCA.crt"); const client = Deno.createHttpClient({ - certChain: await Deno.readTextFile( + cert: await Deno.readTextFile( "tests/testdata/tls/localhost.crt", ), - privateKey: await Deno.readTextFile( + key: await Deno.readTextFile( "tests/testdata/tls/localhost.key", ), caCerts: [caCert], -- cgit v1.2.3