1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 20:12:58 +01:00

upgrade rustls

This commit is contained in:
Nikolay Kim 2018-10-02 13:37:30 -07:00
parent fc7c436387
commit 70efa00646
2 changed files with 7 additions and 7 deletions

View File

@ -67,8 +67,8 @@ openssl = { version="0.10", optional = true }
tokio-openssl = { version="0.2", optional = true } tokio-openssl = { version="0.2", optional = true }
#rustls #rustls
rustls = { version = "^0.13.1", optional = true } rustls = { version = "^0.14", optional = true }
tokio-rustls = { version = "^0.7.2", optional = true } tokio-rustls = { version = "^0.8", optional = true }
webpki = { version = "0.18", optional = true } webpki = { version = "0.18", optional = true }
webpki-roots = { version = "0.15", optional = true } webpki-roots = { version = "0.15", optional = true }

View File

@ -5,7 +5,7 @@ use std::sync::Arc;
use futures::{future::ok, future::FutureResult, Async, Future, Poll}; use futures::{future::ok, future::FutureResult, Async, Future, Poll};
use rustls::{ServerConfig, ServerSession}; use rustls::{ServerConfig, ServerSession};
use tokio_io::{AsyncRead, AsyncWrite}; use tokio_io::{AsyncRead, AsyncWrite};
use tokio_rustls::{AcceptAsync, ServerConfigExt, TlsStream}; use tokio_rustls::{Accept, TlsAcceptor, TlsStream};
use super::MAX_CONN_COUNTER; use super::MAX_CONN_COUNTER;
use counter::{Counter, CounterGuard}; use counter::{Counter, CounterGuard};
@ -49,7 +49,7 @@ impl<T: AsyncRead + AsyncWrite> NewService for RustlsAcceptor<T> {
fn new_service(&self) -> Self::Future { fn new_service(&self) -> Self::Future {
MAX_CONN_COUNTER.with(|conns| { MAX_CONN_COUNTER.with(|conns| {
ok(RustlsAcceptorService { ok(RustlsAcceptorService {
config: self.config.clone(), acceptor: self.config.clone().into(),
conns: conns.clone(), conns: conns.clone(),
io: PhantomData, io: PhantomData,
}) })
@ -58,7 +58,7 @@ impl<T: AsyncRead + AsyncWrite> NewService for RustlsAcceptor<T> {
} }
pub struct RustlsAcceptorService<T> { pub struct RustlsAcceptorService<T> {
config: Arc<ServerConfig>, acceptor: TlsAcceptor,
io: PhantomData<T>, io: PhantomData<T>,
conns: Counter, conns: Counter,
} }
@ -80,7 +80,7 @@ impl<T: AsyncRead + AsyncWrite> Service for RustlsAcceptorService<T> {
fn call(&mut self, req: Self::Request) -> Self::Future { fn call(&mut self, req: Self::Request) -> Self::Future {
RustlsAcceptorServiceFut { RustlsAcceptorServiceFut {
_guard: self.conns.get(), _guard: self.conns.get(),
fut: ServerConfigExt::accept_async(&self.config, req), fut: self.acceptor.accept(req),
} }
} }
} }
@ -89,7 +89,7 @@ pub struct RustlsAcceptorServiceFut<T>
where where
T: AsyncRead + AsyncWrite, T: AsyncRead + AsyncWrite,
{ {
fut: AcceptAsync<T>, fut: Accept<T>,
_guard: CounterGuard, _guard: CounterGuard,
} }