diff --git a/actix-server-config/Cargo.toml b/actix-server-config/Cargo.toml index 7f7cf23f..5f8589b8 100644 --- a/actix-server-config/Cargo.toml +++ b/actix-server-config/Cargo.toml @@ -25,4 +25,5 @@ rustls = ["tokio-rustls"] tokio-io = "0.2.0-alpha.6" tokio-net = "0.2.0-alpha.6" tokio-openssl = { version = "0.4.0-alpha.6", optional = true } -tokio-rustls = { version = "0.12.0-alpha.8", optional = true } +#tokio-rustls = { version = "0.12.0-alpha.8", optional = true } +tokio-rustls = { git = "https://github.com/quininer/tokio-rustls.git", branch = "tokio-0.2", optional = true } diff --git a/actix-server/src/ssl/rustls.rs b/actix-server/src/ssl/rustls.rs index e822e9a0..bb95da0e 100644 --- a/actix-server/src/ssl/rustls.rs +++ b/actix-server/src/ssl/rustls.rs @@ -111,10 +111,14 @@ impl Future for RustlsAcceptorServiceFut, cx: &mut Context) -> Poll { let this = self.get_mut(); - let params = this.params.take().unwrap(); - Poll::Ready( - futures::ready!(Pin::new(&mut this.fut).poll(cx)) - .map(move |io| Io::from_parts(io, params, Protocol::Unknown)), - ) + + let res = futures::ready!(Pin::new(&mut this.fut).poll(cx)); + match res { + Ok(io) => { + let params = this.params.take().unwrap(); + Poll::Ready(Ok(Io::from_parts(io, params, Protocol::Unknown))) + } + Err(e) => Poll::Ready(Err(e)), + } } }