diff --git a/Cargo.toml b/Cargo.toml index e95ffa047..a98b29e81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,8 +67,8 @@ openssl = { version="0.10", optional = true } tokio-openssl = { version="0.2", optional = true } #rustls -rustls = { version = "^0.13.1", optional = true } -tokio-rustls = { version = "^0.7.2", optional = true } +rustls = { version = "^0.14", optional = true } +tokio-rustls = { version = "^0.8", optional = true } webpki = { version = "0.18", optional = true } webpki-roots = { version = "0.15", optional = true } diff --git a/src/ssl/rustls.rs b/src/ssl/rustls.rs index ef4c966be..56d3fd95a 100644 --- a/src/ssl/rustls.rs +++ b/src/ssl/rustls.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use futures::{future::ok, future::FutureResult, Async, Future, Poll}; use rustls::{ServerConfig, ServerSession}; use tokio_io::{AsyncRead, AsyncWrite}; -use tokio_rustls::{AcceptAsync, ServerConfigExt, TlsStream}; +use tokio_rustls::{Accept, TlsAcceptor, TlsStream}; use super::MAX_CONN_COUNTER; use counter::{Counter, CounterGuard}; @@ -49,7 +49,7 @@ impl NewService for RustlsAcceptor { fn new_service(&self) -> Self::Future { MAX_CONN_COUNTER.with(|conns| { ok(RustlsAcceptorService { - config: self.config.clone(), + acceptor: self.config.clone().into(), conns: conns.clone(), io: PhantomData, }) @@ -58,7 +58,7 @@ impl NewService for RustlsAcceptor { } pub struct RustlsAcceptorService { - config: Arc, + acceptor: TlsAcceptor, io: PhantomData, conns: Counter, } @@ -80,7 +80,7 @@ impl Service for RustlsAcceptorService { fn call(&mut self, req: Self::Request) -> Self::Future { RustlsAcceptorServiceFut { _guard: self.conns.get(), - fut: ServerConfigExt::accept_async(&self.config, req), + fut: self.acceptor.accept(req), } } } @@ -89,7 +89,7 @@ pub struct RustlsAcceptorServiceFut where T: AsyncRead + AsyncWrite, { - fut: AcceptAsync, + fut: Accept, _guard: CounterGuard, }