Skip to content

Commit

Permalink
Remove deprecated add_server_trust_anchors & append missing features (
Browse files Browse the repository at this point in the history
  • Loading branch information
ptazithos authored Jul 29, 2024
1 parent 896da8a commit eadb437
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
42 changes: 39 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,31 @@ name = "tls_client"
path = "examples/tls_client.rs"
required-features = ["upgrade"]

[[example]]
name = "tls_server"
path = "examples/tls_server.rs"
required-features = ["upgrade"]

[[example]]
name = "axum"
path = "examples/axum.rs"
required-features = ["upgrade", "with_axum"]

[[example]]
name = "echo_server_split"
path = "examples/echo_server_split.rs"
required-features = ["upgrade"]

[dependencies]
tokio = { version = "1.25.0", default-features = false, features = ["io-util"] }
tokio = { version = "1.25.0", default-features = false, features = ["io-util"] }
simdutf8 = { version = "0.1.4", optional = true }
hyper-util = { version = "0.1.0", features = ["tokio"], optional = true }
http-body-util = { version = "0.1.0", optional = true }
hyper = { version = "1", features = ["http1", "server", "client"], optional = true }
hyper = { version = "1", features = [
"http1",
"server",
"client",
], optional = true }
pin-project = { version = "1.0.8", optional = true }
base64 = { version = "0.21.0", optional = true }
sha1 = { version = "0.10.5", optional = true }
Expand All @@ -49,7 +63,14 @@ async-trait = { version = "0.1", optional = true }
[features]
default = ["simd"]
simd = ["simdutf8/aarch64_neon"]
upgrade = ["hyper", "pin-project", "base64", "sha1", "hyper-util", "http-body-util"]
upgrade = [
"hyper",
"pin-project",
"base64",
"sha1",
"hyper-util",
"http-body-util",
]
unstable-split = []
# Axum integration
with_axum = ["axum-core", "http", "async-trait"]
Expand All @@ -69,6 +90,21 @@ webpki-roots = "0.23.0"
bytes = "1.4.0"
axum = "0.7.4"

[[test]]
name = "upgrade"
path = "tests/upgrade.rs"
required-features = ["upgrade"]

[[test]]
name = "split"
path = "tests/split.rs"
required-features = ["upgrade"]

[[test]]
name = "concurrency"
path = "tests/concurrency.rs"
required-features = ["upgrade"]

[[bench]]
name = "unmask"
harness = false
Expand Down
8 changes: 4 additions & 4 deletions examples/tls_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ where
fn tls_connector() -> Result<TlsConnector> {
let mut root_store = tokio_rustls::rustls::RootCertStore::empty();

root_store.add_server_trust_anchors(
webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(
|ta| {
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
}),
);
},
));

let config = ClientConfig::builder()
.with_safe_defaults()
Expand Down
2 changes: 1 addition & 1 deletion src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl<'f> Frame<'f> {
return Ok(());
}

// Slighly more optimized than (unstable) write_all_vectored for 2 iovecs.
// Slightly more optimized than (unstable) write_all_vectored for 2 iovecs.
while n <= size {
b[0] = IoSlice::new(&head[n..size]);
n += stream.write_vectored(&b).await?;
Expand Down

0 comments on commit eadb437

Please sign in to comment.