tokio-rustls: initialize Acceptor with default() in tests (#119)

This commit is contained in:
Dirkjan Ochtman 2022-10-23 07:43:45 +02:00 committed by GitHub
parent c033514814
commit 24473eaff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
tokio = "1.0" tokio = "1.0"
rustls = { version = "0.20", default-features = false } rustls = { version = "0.20.7", default-features = false }
webpki = "0.22" webpki = "0.22"
[features] [features]

View File

@ -176,7 +176,7 @@ async fn test_lazy_config_acceptor() -> io::Result<()> {
client.read_to_end(&mut buf).await.unwrap(); client.read_to_end(&mut buf).await.unwrap();
}); });
let acceptor = LazyConfigAcceptor::new(rustls::server::Acceptor::new().unwrap(), sstream); let acceptor = LazyConfigAcceptor::new(rustls::server::Acceptor::default(), sstream);
let start = acceptor.await.unwrap(); let start = acceptor.await.unwrap();
let ch = start.client_hello(); let ch = start.client_hello();
@ -201,7 +201,7 @@ async fn test_lazy_config_acceptor() -> io::Result<()> {
#[tokio::test] #[tokio::test]
async fn lazy_config_acceptor_eof() { async fn lazy_config_acceptor_eof() {
let buf = Cursor::new(Vec::new()); let buf = Cursor::new(Vec::new());
let acceptor = LazyConfigAcceptor::new(rustls::server::Acceptor::new().unwrap(), buf); let acceptor = LazyConfigAcceptor::new(rustls::server::Acceptor::default(), buf);
let accept_result = match time::timeout(Duration::from_secs(3), acceptor).await { let accept_result = match time::timeout(Duration::from_secs(3), acceptor).await {
Ok(res) => res, Ok(res) => res,