1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/tests/integration
Matt Mastracci 684377c92c
refactor(ext/tls): Implement required functionality for later SNI support (#23686)
Precursor to #23236 

This implements the SNI features, but uses private symbols to avoid
exposing the functionality at this time. Note that to properly test this
feature, we need to add a way for `connectTls` to specify a hostname.
This is something that should be pushed into that API at a later time as
well.

```ts
Deno.test(
  { permissions: { net: true, read: true } },
  async function listenResolver() {
    let sniRequests = [];
    const listener = Deno.listenTls({
      hostname: "localhost",
      port: 0,
      [resolverSymbol]: (sni: string) => {
        sniRequests.push(sni);
        return {
          cert,
          key,
        };
      },
    });

    {
      const conn = await Deno.connectTls({
        hostname: "localhost",
        [serverNameSymbol]: "server-1",
        port: listener.addr.port,
      });
      const [_handshake, serverConn] = await Promise.all([
        conn.handshake(),
        listener.accept(),
      ]);
      conn.close();
      serverConn.close();
    }

    {
      const conn = await Deno.connectTls({
        hostname: "localhost",
        [serverNameSymbol]: "server-2",
        port: listener.addr.port,
      });
      const [_handshake, serverConn] = await Promise.all([
        conn.handshake(),
        listener.accept(),
      ]);
      conn.close();
      serverConn.close();
    }

    assertEquals(sniRequests, ["server-1", "server-2"]);
    listener.close();
  },
);
```

---------

Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-05-09 10:54:47 -06:00
..
bench_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
bundle_tests.rs chore: fix typos (#22677) 2024-03-04 14:28:57 +00:00
cache_tests.rs chore: fix flaky net_listen_allow_localhost_4555 (#23726) 2024-05-07 17:21:56 +00:00
check_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
compile_tests.rs chore: fix flaky net_listen_allow_localhost_4555 (#23726) 2024-05-07 17:21:56 +00:00
coverage_tests.rs chore: cleanup some coverage tests (#23738) 2024-05-08 16:07:56 -04:00
doc_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
eval_tests.rs chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00
flags_tests.rs chore: move more tests away from itest (#22909) 2024-03-15 15:46:51 -04:00
fmt_tests.rs fix(publish): make include and exclude work (#22720) 2024-03-07 20:16:32 -05:00
info_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
init_tests.rs feat(init): use jsr specifier for @std/assert (#23073) 2024-03-27 18:51:52 +01:00
inspector_tests.rs chore: enable clippy::print_stdout and clippy::print_stderr (#23732) 2024-05-08 22:45:06 -04:00
install_tests.rs feat(install): require -g / --global flag (#23060) 2024-03-27 23:45:57 +01:00
js_unit_tests.rs refactor(ext/tls): Implement required functionality for later SNI support (#23686) 2024-05-09 10:54:47 -06:00
jsr_tests.rs chore: add tests for moduleGraph2 (#23603) 2024-04-29 14:09:58 -04:00
jupyter_tests.rs fix(lsp): Pass diagnostic codes to TSC as numbers (#23720) 2024-05-06 23:54:52 +00:00
lint_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
lsp_tests.rs fix(lsp): move sloppy import resolution from loader to resolver (#23751) 2024-05-09 14:17:31 +00:00
mod.rs chore: enable clippy::print_stdout and clippy::print_stderr (#23732) 2024-05-08 22:45:06 -04:00
node_compat_tests.rs fix(ext/node): dispatch beforeExit/exit events irrespective of listeners (#23382) 2024-04-16 13:45:41 +00:00
node_unit_tests.rs fix(ext/node): polyfill node:domain module (#23088) 2024-04-03 21:37:10 +02:00
npm_tests.rs chore: fix flaky net_listen_allow_localhost_4555 (#23726) 2024-05-07 17:21:56 +00:00
pm_tests.rs fix(cli): avoid deno add and deno vendor errors when deno.json is empty (#23439) 2024-04-18 15:48:15 -04:00
publish_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
repl_tests.rs chore: make a couple repl tests less flaky (#23636) 2024-05-01 16:37:17 +00:00
run_tests.rs refactor(ext/tls): Implement required functionality for later SNI support (#23686) 2024-05-09 10:54:47 -06:00
shared_library_tests.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
task_tests.rs feat(task): support running npm binary commands in deno.json (#23478) 2024-04-20 20:13:46 -04:00
test_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
upgrade_tests.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
vendor_tests.rs chore: fix flaky net_listen_allow_localhost_4555 (#23726) 2024-05-07 17:21:56 +00:00
watcher_tests.rs chore: maybe make fmt_check_all_files_on_each_change_test less flaky (#23704) 2024-05-05 18:09:45 -04:00
worker_tests.rs refactor(tests): move worker_threads itests to spec tests (#23648) 2024-05-03 05:52:47 +00:00