tokio-xmpp: explicitly set default CryptoProvider in all examples
This way, we don't end up with breakage if rustls is built with more than one provider enabled. This can (and does) happen if a transitive dependency (such as reqwest *hinthint*) depends on a specific, non-default rustls backend.
This commit is contained in:
parent
78714475b2
commit
025e09aca6
6 changed files with 36 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ use std::fs::{create_dir_all, File};
|
|||
use std::io::{self, Write};
|
||||
use std::process::exit;
|
||||
use std::str::FromStr;
|
||||
use tokio_xmpp::{Client, Stanza};
|
||||
use tokio_xmpp::{rustls, Client, Stanza};
|
||||
use xmpp_parsers::{
|
||||
avatar::{Data as AvatarData, Metadata as AvatarMetadata},
|
||||
caps::{compute_disco, hash_caps, Caps},
|
||||
|
|
@ -26,6 +26,11 @@ use xmpp_parsers::{
|
|||
async fn main() {
|
||||
env_logger::init();
|
||||
|
||||
#[cfg(feature = "tls-rust")]
|
||||
rustls::crypto::aws_lc_rs::default_provider()
|
||||
.install_default()
|
||||
.expect("failed to install rustls crypto provider");
|
||||
|
||||
let args: Vec<String> = args().collect();
|
||||
if args.len() != 3 {
|
||||
println!("Usage: {} <jid> <password>", args[0]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue