Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ description = "wrap incoming Stream of connections in TLS"
version = "0.11.1"
authors = ["Thayne McCombs <astrothayne@gmail.com>"]
repository = "https://github.com/tmccombs/tls-listener"
edition = "2021"
edition = "2024"
license = "Apache-2.0"
rust-version = "1.85"

[features]
default = ["tokio-net"]
Expand Down
2 changes: 1 addition & 1 deletion examples/axum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use axum::{routing::get, Router};
use axum::{Router, routing::get};
use std::net::SocketAddr;
use tls_listener::TlsListener;
use tokio::net::TcpListener;
Expand Down
6 changes: 3 additions & 3 deletions examples/http-change-certificate.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use hyper::server::conn::http1;
use hyper::service::service_fn;
use hyper::{body::Body, Request, Response};
use hyper::{Request, Response, body::Body};
use hyper_util::rt::tokio::TokioIo;
use std::convert::Infallible;
use std::num::NonZeroUsize;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use std::sync::atomic::{AtomicU64, Ordering};
use tokio::net::TcpListener;

mod tls_config;
use tls_config::{tls_acceptor, tls_acceptor2, Acceptor};
use tls_config::{Acceptor, tls_acceptor, tls_acceptor2};
use tokio::sync::mpsc;

/// To view the current certificate try:
Expand Down
2 changes: 1 addition & 1 deletion examples/tls_config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
mod config {
use std::sync::Arc;
use tokio_rustls::rustls::{
pki_types::{CertificateDer, PrivateKeyDer},
ServerConfig,
pki_types::{CertificateDer, PrivateKeyDer},
};

const CERT: &[u8] = include_bytes!("local.cert");
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ use pin_project_lite::pin_project;
#[cfg(feature = "rt")]
pub use spawning_handshake::SpawningHandshakes;
use std::fmt::Debug;
use std::future::{poll_fn, Future};
use std::future::{Future, poll_fn};
use std::num::NonZeroUsize;
use std::pin::Pin;
use std::task::{ready, Context, Poll};
use std::task::{Context, Poll, ready};
use std::time::Duration;
use thiserror::Error;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::time::{timeout, Timeout};
use tokio::time::{Timeout, timeout};
#[cfg(feature = "native-tls")]
pub use tokio_native_tls as native_tls;
#[cfg(feature = "openssl")]
Expand All @@ -48,7 +48,7 @@ pub use accept::*;
mod axum;

/// Default number of connections to accept in a batch before trying to
pub const DEFAULT_ACCEPT_BATCH_SIZE: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(64) };
pub const DEFAULT_ACCEPT_BATCH_SIZE: NonZeroUsize = NonZeroUsize::new(64).unwrap();
/// Default timeout for the TLS handshake.
pub const DEFAULT_HANDSHAKE_TIMEOUT: Duration = Duration::from_secs(10);

Expand Down
2 changes: 1 addition & 1 deletion tests/helper/asserts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ macro_rules! assert_err {
}

macro_rules! assert_ascii_eq {
($one:expr, $two:expr) => {
($one:expr, $two:expr_2021) => {
assert_eq!(
::std::str::from_utf8(&*$one).unwrap(),
::std::str::from_utf8(&*$two).unwrap()
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::pin::Pin;
use std::sync::atomic::{AtomicU32, Ordering};
use std::task::{Context, Poll};
use tokio::io::{
duplex, split, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, DuplexStream, ReadBuf,
AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, DuplexStream, ReadBuf, duplex, split,
};
use tokio::sync::mpsc;

Expand Down