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,11 +4,17 @@ use tokio::{self, io, net::TcpSocket};
|
|||
use tokio_xmpp::{
|
||||
minidom::Element,
|
||||
parsers::stream_features::StreamFeatures,
|
||||
rustls,
|
||||
xmlstream::{accept_stream, StreamHeader, Timeouts},
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), io::Error> {
|
||||
#[cfg(feature = "tls-rust")]
|
||||
rustls::crypto::aws_lc_rs::default_provider()
|
||||
.install_default()
|
||||
.expect("failed to install rustls crypto provider");
|
||||
|
||||
// TCP socket
|
||||
let address = "127.0.0.1:5222".parse().unwrap();
|
||||
let socket = TcpSocket::new_v4()?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue