2024-01-01 14:58:21 -05:00
|
|
|
# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2021-08-07 08:49:38 -04:00
|
|
|
|
|
|
|
[package]
|
|
|
|
name = "deno_tls"
|
2024-05-16 21:57:53 -04:00
|
|
|
version = "0.139.0"
|
2022-11-22 15:07:35 -05:00
|
|
|
authors.workspace = true
|
|
|
|
edition.workspace = true
|
|
|
|
license.workspace = true
|
2021-08-07 08:49:38 -04:00
|
|
|
readme = "README.md"
|
2022-11-22 15:07:35 -05:00
|
|
|
repository.workspace = true
|
2021-08-07 08:49:38 -04:00
|
|
|
description = "TLS for Deno"
|
|
|
|
|
|
|
|
[lib]
|
|
|
|
path = "lib.rs"
|
|
|
|
|
|
|
|
[dependencies]
|
2022-11-22 15:07:35 -05:00
|
|
|
deno_core.workspace = true
|
2023-11-05 03:14:58 -05:00
|
|
|
deno_native_certs = "0.2.0"
|
2022-11-22 15:07:35 -05:00
|
|
|
rustls = { workspace = true, features = ["dangerous_configuration"] }
|
|
|
|
rustls-pemfile.workspace = true
|
2024-02-09 15:33:05 -05:00
|
|
|
rustls-tokio-stream.workspace = true
|
2023-08-25 17:40:25 -04:00
|
|
|
rustls-webpki.workspace = true
|
2022-11-22 15:07:35 -05:00
|
|
|
serde.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 12:54:47 -04:00
|
|
|
tokio.workspace = true
|
2023-08-25 17:40:25 -04:00
|
|
|
webpki-roots.workspace = true
|