diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-05-17 02:19:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 02:19:23 +0200 |
commit | cb87cb0283fbe95ace2317b0617e7e74382bf4db (patch) | |
tree | b75c51f15680cfb1f3d6f17cd44e485ec2b58e4f /cli/tests/unit/fetch_test.ts | |
parent | 867a6d303285cdffd060e6bb4b0e97de73925cfe (diff) |
fix: support "fetch" over HTTPS for IP addresses (#18499)
This commit adds support for connecting to IP addresses over HTTPS.
This is done by updating "rustls" to "0.21.0" and other related crates.
Closes https://github.com/denoland/deno/issues/7660
Closes https://github.com/denoland/deno/issues/17967
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/tests/unit/fetch_test.ts')
-rw-r--r-- | cli/tests/unit/fetch_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index a92a7a051..7de04013e 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -1497,6 +1497,18 @@ Deno.test( Deno.test( { permissions: { net: true, read: true } }, + async function fetchSupportsHttpsOverIpAddress() { + const caCert = await Deno.readTextFile("cli/tests/testdata/tls/RootCA.pem"); + const client = Deno.createHttpClient({ caCerts: [caCert] }); + const res = await fetch("https://localhost:5546/http_version", { client }); + assert(res.ok); + assertEquals(await res.text(), "HTTP/1.1"); + client.close(); + }, +); + +Deno.test( + { permissions: { net: true, read: true } }, async function fetchSupportsHttp1Only() { const caCert = await Deno.readTextFile("cli/tests/testdata/tls/RootCA.pem"); const client = Deno.createHttpClient({ caCerts: [caCert] }); |