Avoid enabling multiple rustls backends by accident

For this, we had to:

- Make the choice(s) of backend explicit in tokio-xmpp features
- Avoid picking a backend through transitive dependencies in xmpp
  (reqwest->hyper->rustls).

In addition, we choose the default rustls backend by default and adapt
the examples so that they can cope with either situation.
This commit is contained in:
Jonas Schäfer 2025-05-10 09:54:01 +02:00
commit 4e9e18444c
11 changed files with 134 additions and 15 deletions

View file

@ -33,7 +33,7 @@ hickory-resolver = { version = "0.24", optional = true}
idna = { version = "1.0", optional = true}
native-tls = { version = "0.2", optional = true }
tokio-native-tls = { version = "0.3", optional = true }
tokio-rustls = { version = "0.26", optional = true }
tokio-rustls = { version = "0.26", optional = true, default-features = false, features = ["logging", "tls12"] }
ktls = { version = "6", optional = true }
[dev-dependencies]
@ -43,9 +43,11 @@ tokio = { version = "1", features = ["signal", "test-util"] }
tokio-xmpp = { path = ".", features = ["insecure-tcp"]}
[features]
default = ["starttls-rust", "rustls-native-certs"]
default = ["starttls-rust", "rustls-native-certs", "tls-rust-aws_lc_rs"]
starttls = ["dns"]
tls-rust = ["tokio-rustls"]
tls-rust-aws_lc_rs = ["tokio-rustls?/aws_lc_rs"]
tls-rust-ring = ["tokio-rustls?/ring"]
tls-rust-ktls = ["tls-rust", "ktls"]
tls-rust-native-certs = ["tls-rust", "rustls-native-certs"]
tls-rust-webpki-roots = ["tls-rust", "webpki-roots"]