From e733c562d95cc5dca7637bb9bf64925fb7d41d65 Mon Sep 17 00:00:00 2001 From: Jerome Gravel-Niquet Date: Thu, 3 Oct 2019 14:32:32 -0400 Subject: [PATCH] Update rustls, tokio-rustls and webpki across the board (#42) * Update rustls, tokio-rustls and webpki across the board * bump minimum rust version to 1.37 * updated readme and changelogs to reflect changes and minimum required rust version --- .travis.yml | 2 +- README.md | 2 +- actix-connect/CHANGES.md | 7 +++++++ actix-connect/Cargo.toml | 6 +++--- actix-connect/src/ssl/rustls.rs | 13 +++++-------- actix-server-config/Cargo.toml | 4 ++-- actix-server-config/changes.md | 7 +++++++ actix-server-config/src/lib.rs | 2 +- actix-server/CHANGES.md | 7 +++++++ actix-server/Cargo.toml | 8 ++++---- actix-server/src/ssl/rustls.rs | 10 +++++----- 11 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21c3ebc4..6eaf6d1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ matrix: include: - rust: stable - rust: beta - - rust: 1.36.0 + - rust: 1.37.0 - rust: nightly-2019-06-15 allow_failures: - rust: nightly-2019-06-15 diff --git a/README.md b/README.md index 99ecd5fc..5c100657 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Actix net - framework for composable network services * [API Documentation (Development)](https://actix.rs/actix-net/actix_net/) * [Chat on gitter](https://gitter.im/actix/actix) * Cargo package: [actix-net](https://crates.io/crates/actix-net) -* Minimum supported Rust version: 1.36 or later +* Minimum supported Rust version: 1.37 or later ## Example diff --git a/actix-connect/CHANGES.md b/actix-connect/CHANGES.md index 95ac002e..00dfe4d6 100644 --- a/actix-connect/CHANGES.md +++ b/actix-connect/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## Next + +### Changed + +* Update `rustls` to 0.16 +* Minimum required Rust version upped to 1.37.0 + ## [0.2.5] - 2019-09-05 * Add `TcpConnectService` diff --git a/actix-connect/Cargo.toml b/actix-connect/Cargo.toml index d7d0c276..4a2a0146 100644 --- a/actix-connect/Cargo.toml +++ b/actix-connect/Cargo.toml @@ -51,9 +51,9 @@ openssl = { version="0.10", optional = true } tokio-openssl = { version="0.3", optional = true } #rustls -rustls = { version = "0.15.2", optional = true } -tokio-rustls = { version = "0.9.1", optional = true } -webpki = { version = "0.19", optional = true } +rustls = { version = "0.16.0", optional = true } +tokio-rustls = { version = "0.10.0", optional = true } +webpki = { version = "0.21", optional = true } [dev-dependencies] bytes = "0.4" diff --git a/actix-connect/src/ssl/rustls.rs b/actix-connect/src/ssl/rustls.rs index 9a518507..7d6f5720 100644 --- a/actix-connect/src/ssl/rustls.rs +++ b/actix-connect/src/ssl/rustls.rs @@ -5,10 +5,7 @@ use actix_codec::{AsyncRead, AsyncWrite}; use actix_service::{NewService, Service}; use futures::{future::ok, future::FutureResult, Async, Future, Poll}; use std::sync::Arc; -use tokio_rustls::{ - rustls::{ClientConfig, ClientSession}, - Connect, TlsConnector, TlsStream, -}; +use tokio_rustls::{client::TlsStream, rustls::ClientConfig, Connect, TlsConnector}; use webpki::DNSNameRef; use crate::{Address, Connection}; @@ -37,7 +34,7 @@ where connector: Arc, ) -> impl Service< Request = Connection, - Response = Connection>, + Response = Connection>, Error = std::io::Error, > { RustlsConnectorService { @@ -61,7 +58,7 @@ where U: AsyncRead + AsyncWrite + fmt::Debug, { type Request = Connection; - type Response = Connection>; + type Response = Connection>; type Error = std::io::Error; type Config = (); type Service = RustlsConnectorService; @@ -86,7 +83,7 @@ where U: AsyncRead + AsyncWrite + fmt::Debug, { type Request = Connection; - type Response = Connection>; + type Response = Connection>; type Error = std::io::Error; type Future = ConnectAsyncExt; @@ -114,7 +111,7 @@ impl Future for ConnectAsyncExt where U: AsyncRead + AsyncWrite + fmt::Debug, { - type Item = Connection>; + type Item = Connection>; type Error = std::io::Error; fn poll(&mut self) -> Poll { diff --git a/actix-server-config/Cargo.toml b/actix-server-config/Cargo.toml index 08af1acf..3e892742 100644 --- a/actix-server-config/Cargo.toml +++ b/actix-server-config/Cargo.toml @@ -33,6 +33,6 @@ futures = "0.1.25" tokio-io = "0.1.12" tokio-tcp = "0.1" tokio-openssl = { version="0.3.0", optional = true } -rustls = { version = "0.15.2", optional = true } -tokio-rustls = { version = "0.9.1", optional = true } +rustls = { version = "0.16.0", optional = true } +tokio-rustls = { version = "0.10.0", optional = true } tokio-uds = { version="0.2.5", optional = true } diff --git a/actix-server-config/changes.md b/actix-server-config/changes.md index 7e8ebfbd..6f514080 100644 --- a/actix-server-config/changes.md +++ b/actix-server-config/changes.md @@ -1,5 +1,12 @@ # Changes +## Next + +### Changed + +* Update `rustls` to 0.16 +* Minimum required Rust version upped to 1.37.0 + ## [0.1.2] - 2019-07-18 ### Added diff --git a/actix-server-config/src/lib.rs b/actix-server-config/src/lib.rs index 85f72bdb..fc5dac04 100644 --- a/actix-server-config/src/lib.rs +++ b/actix-server-config/src/lib.rs @@ -195,7 +195,7 @@ impl IoStream for tokio_openssl::SslStream { } #[cfg(any(feature = "rust-tls"))] -impl IoStream for tokio_rustls::TlsStream { +impl IoStream for tokio_rustls::server::TlsStream { #[inline] fn peer_addr(&self) -> Option { self.get_ref().0.peer_addr() diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 6ab3bcc9..c317b56d 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## Next + +### Changed + +* Update `rustls` to 0.16 +* Minimum required Rust version upped to 1.37.0 + ## [0.6.1] - 2019-09-25 ### Added diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index 2bda582a..30183a08 100644 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -65,10 +65,10 @@ openssl = { version="0.10", optional = true } tokio-openssl = { version="0.3", optional = true } # rustls -rustls = { version = "0.15.2", optional = true } -tokio-rustls = { version = "0.9.1", optional = true } -webpki = { version = "0.19", optional = true } -webpki-roots = { version = "0.16", optional = true } +rustls = { version = "0.16.0", optional = true } +tokio-rustls = { version = "0.10.0", optional = true } +webpki = { version = "0.21", optional = true } +webpki-roots = { version = "0.17", optional = true } [dev-dependencies] bytes = "0.4" diff --git a/actix-server/src/ssl/rustls.rs b/actix-server/src/ssl/rustls.rs index 151bbbd6..06edc0f5 100644 --- a/actix-server/src/ssl/rustls.rs +++ b/actix-server/src/ssl/rustls.rs @@ -4,9 +4,9 @@ use std::sync::Arc; use actix_service::{NewService, Service}; use futures::{future::ok, future::FutureResult, Async, Future, Poll}; -use rustls::{ServerConfig, ServerSession}; +use rustls::ServerConfig; use tokio_io::{AsyncRead, AsyncWrite}; -use tokio_rustls::{Accept, TlsAcceptor, TlsStream}; +use tokio_rustls::{server::TlsStream, Accept, TlsAcceptor}; use crate::counter::{Counter, CounterGuard}; use crate::ssl::MAX_CONN_COUNTER; @@ -41,7 +41,7 @@ impl Clone for RustlsAcceptor { impl NewService for RustlsAcceptor { type Request = Io; - type Response = Io, P>; + type Response = Io, P>; type Error = io::Error; type Config = SrvConfig; @@ -70,7 +70,7 @@ pub struct RustlsAcceptorService { impl Service for RustlsAcceptorService { type Request = Io; - type Response = Io, P>; + type Response = Io, P>; type Error = io::Error; type Future = RustlsAcceptorServiceFut; @@ -102,7 +102,7 @@ where } impl Future for RustlsAcceptorServiceFut { - type Item = Io, P>; + type Item = Io, P>; type Error = io::Error; fn poll(&mut self) -> Poll {