2024-01-01 19:58:21 +00:00
|
|
|
# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2021-08-07 12:49:38 +00:00
|
|
|
|
|
|
|
[package]
|
|
|
|
name = "deno_tls"
|
2024-11-21 02:05:02 +00:00
|
|
|
version = "0.165.0"
|
2022-11-22 20:07:35 +00:00
|
|
|
authors.workspace = true
|
|
|
|
edition.workspace = true
|
|
|
|
license.workspace = true
|
2021-08-07 12:49:38 +00:00
|
|
|
readme = "README.md"
|
2022-11-22 20:07:35 +00:00
|
|
|
repository.workspace = true
|
2021-08-07 12:49:38 +00:00
|
|
|
description = "TLS for Deno"
|
|
|
|
|
|
|
|
[lib]
|
|
|
|
path = "lib.rs"
|
|
|
|
|
|
|
|
[dependencies]
|
2022-11-22 20:07:35 +00:00
|
|
|
deno_core.workspace = true
|
2024-07-02 00:09:47 +00:00
|
|
|
deno_native_certs = "0.3.0"
|
|
|
|
rustls.workspace = true
|
2022-11-22 20:07:35 +00:00
|
|
|
rustls-pemfile.workspace = true
|
2024-02-09 20:33:05 +00:00
|
|
|
rustls-tokio-stream.workspace = true
|
2023-08-25 21:40:25 +00:00
|
|
|
rustls-webpki.workspace = true
|
2022-11-22 20:07:35 +00:00
|
|
|
serde.workspace = true
|
2024-10-12 23:53:38 +00:00
|
|
|
thiserror.workspace = true
|
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 16:54:47 +00:00
|
|
|
tokio.workspace = true
|
2023-08-25 21:40:25 +00:00
|
|
|
webpki-roots.workspace = true
|