Skip to content

Commit

Permalink
Set minimal dependency from rustls (0.21.6)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nepalez authored and Jarema committed Sep 18, 2023
1 parent 9fa089b commit 77bf038
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions async-nats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 77bf038

Please sign in to comment.