From 77bf038a4fb7d0f99df1a3ae936107ed2aa1db97 Mon Sep 17 00:00:00 2001 From: Andrew Kozin Date: Fri, 15 Sep 2023 12:54:54 +0100 Subject: [PATCH] Set minimal dependency from rustls (0.21.6) In the crate tokio-rustls-0.24.0 the dependency from the crate rustls is too loose (0.21.0). To reproduce the problem: cargo +nightly update -Z minimal-versions cargo check --package async-nats --all-targets which fails with errors: error[E0599]: no method named `add_trust_anchors` found for struct `RootCertStore` in the current scope --> async-nats/src/tls.rs:108:28 | 108 | root_store.add_trust_anchors(trust_anchors); | ^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `add_server_trust_anchors` error[E0599]: no method named `with_client_auth_cert` found for struct `ConfigBuilder` in the current scope --> async-nats/src/tls.rs:117:29 | 117 | builder.with_client_auth_cert(cert, key).map_err(|_| { | ^^^^^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `with_no_client_auth` The first error evades after updating rustls to 0.21.5, the second one requires 0.21.6. --- async-nats/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/async-nats/Cargo.toml b/async-nats/Cargo.toml index 34f8d3982..b207b5b00 100644 --- a/async-nats/Cargo.toml +++ b/async-nats/Cargo.toml @@ -41,6 +41,9 @@ ring = "0.16" rand = "0.8" webpki = { package = "rustls-webpki", version = "0.101.2", features = ["alloc", "std"] } +# for -Z minimal-versions +rustls = "0.21.6" # used by tokio-rustls 0.24.0 + [dev-dependencies] criterion = { version = "0.5", features = ["async_tokio"]} nats-server = { path = "../nats-server" }