diff --git a/Cargo.toml b/Cargo.toml index 14a5101..c6c1ae8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,48 +37,48 @@ async = [ log = { version = "0.4", optional = true, features = ["std"] } # just the futures traits -futures-lite = { version = "1.8", optional = true } +futures-lite = { version = "1.11", optional = true } # field pin projection -pin-project-lite = { version = "0.1", optional = true } +pin-project-lite = { version = "0.2", optional = true } # cloneable async writes async-dup = { version = "1.2", optional = true } # message passing -async-channel = { version = "1.4", optional = true } +async-channel = { version = "1.5", optional = true } # for timing out futures futures-timer = { version = "3.0", optional = true } # for 'fairness' in the main loop -fastrand = { version = "1.3", optional = true } +fastrand = { version = "1.4", optional = true } # for optional serialization and deserialization serde = { version = "1.0", features = ["derive"], optional = true } # optional runtimes (for TcpStream) # these use the futures AsyncWrite+AsyncRead -async-io = { version = "1.1", optional = true } +async-io = { version = "1.3", optional = true } smol = { version = "1.2", optional = true } -async-tls = { version = "0.10", default-features = false, features = ["client"], optional = true } +async-tls = { version = "0.11", default-features = false, features = ["client"], optional = true } # TODO look into what their features do. the ones they have enabled by default seem important -async-std = { version = "1.6", optional = true } +async-std = { version = "1.9", optional = true } # tokio has its own AsyncWrite+AsyncRead -tokio = { version = "0.2", features = ["net"], optional = true } -tokio-util = { version = "0.3", features = ["compat"], optional = true } +tokio = { version = "1.2", features = ["net"], optional = true } +tokio-util = { version = "0.6", features = ["compat"], optional = true } # rustls -tokio-rustls = { version = "0.14", optional = true } -webpki-roots = { version = "0.20", optional = true } +tokio-rustls = { version = "0.22", optional = true } +webpki-roots = { version = "0.21", optional = true } # native-tls -tokio-native-tls = { version = "0.1", optional = true } +tokio-native-tls = { version = "0.3", optional = true } native-tls = { version = "0.2", optional = true } # openssl -tokio-openssl = { version = "0.4", optional = true } +tokio-openssl = { version = "0.6", optional = true } openssl = { version = "0.10", optional = true, features = ["v110"] } # for some test utilities @@ -87,9 +87,9 @@ async-mutex = { version = "1.4", optional = true } [dev-dependencies] anyhow = "1.0" -async-executor = { version = "1.3", default-features = false } +async-executor = { version = "1.4", default-features = false } serde_json = "1.0" -rmp-serde = "0.14" +rmp-serde = "0.15.4" [[example]] name = "message_parse" diff --git a/src/connector/tokio/native_tls.rs b/src/connector/tokio/native_tls.rs index aa3e86a..0ceabba 100644 --- a/src/connector/tokio/native_tls.rs +++ b/src/connector/tokio/native_tls.rs @@ -27,7 +27,7 @@ impl crate::connector::Connector for ConnectorNativeTls { let this = self.clone(); let fut = async move { - use tokio_util::compat::Tokio02AsyncReadCompatExt as _; + use tokio_util::compat::TokioAsyncReadCompatExt as _; let connector: tokio_native_tls::TlsConnector = ::native_tls::TlsConnector::new() .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))? diff --git a/src/connector/tokio/non_tls.rs b/src/connector/tokio/non_tls.rs index d59e885..bdfc353 100644 --- a/src/connector/tokio/non_tls.rs +++ b/src/connector/tokio/non_tls.rs @@ -18,7 +18,7 @@ impl crate::connector::Connector for Connector { fn connect(&mut self) -> BoxedFuture> { let addrs = self.addrs.clone(); let fut = async move { - use tokio_util::compat::Tokio02AsyncReadCompatExt as _; + use tokio_util::compat::TokioAsyncReadCompatExt as _; let stream = tokio::net::TcpStream::connect(&*addrs).await?; Ok(async_dup::Mutex::new(stream.compat())) }; diff --git a/src/connector/tokio/openssl.rs b/src/connector/tokio/openssl.rs index ce090ab..01f7c9d 100644 --- a/src/connector/tokio/openssl.rs +++ b/src/connector/tokio/openssl.rs @@ -29,14 +29,18 @@ impl crate::connector::Connector for ConnectorOpenSsl { let this = self.clone(); let fut = async move { - use tokio_util::compat::Tokio02AsyncReadCompatExt as _; + use tokio_util::compat::TokioAsyncReadCompatExt as _; let config = ::openssl::ssl::SslConnector::builder(::openssl::ssl::SslMethod::tls()) .and_then(|c| c.build().configure()) .map_err(|err| Error::new(ErrorKind::Other, err))?; let stream = tokio::net::TcpStream::connect(&*this.addrs).await?; - let stream = tokio_openssl::connect(config, &this.tls_domain, stream) + let ssl = config.into_ssl(&this.tls_domain).map_err(|err| Error::new(ErrorKind::Other, err))?; + let mut stream = tokio_openssl::SslStream::new(ssl, stream) + .map_err(|err| Error::new(ErrorKind::Other, err))?; + std::pin::Pin::new(&mut stream) + .connect() .await .map_err(|err| Error::new(ErrorKind::Other, err))?; diff --git a/src/connector/tokio/rustls.rs b/src/connector/tokio/rustls.rs index 85fb7ff..d1fbe00 100644 --- a/src/connector/tokio/rustls.rs +++ b/src/connector/tokio/rustls.rs @@ -25,7 +25,7 @@ impl crate::connector::Connector for ConnectorRustTls { fn connect(&mut self) -> BoxedFuture> { let this = self.clone(); let fut = async move { - use tokio_util::compat::Tokio02AsyncReadCompatExt as _; + use tokio_util::compat::TokioAsyncReadCompatExt as _; let domain = tokio_rustls::webpki::DNSNameRef::try_from_ascii_str(&this.tls_domain) .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;