This PR adds a timeout to the TLS handshake, to guard against TCP connection leaks arising from poor connections or malicious activity. This type of connection leak can seriously impair an internet-facing server (I know from experience). A test case is included to verify the functionality works.
This PR adds a timeout to the TLS handshake, to guard against TCP connection leaks arising from poor connections or malicious activity. This type of connection leak can seriously impair an internet-facing server (I know from experience). A test case is included to verify the functionality works.
The downside is that a https://docs.rs/tokio/latest/tokio/time/struct.Sleep.html is required per connection being accepted, which I believe is a heap allocation.
Please note: This PR is on top of my
AddrIncomingConfig
PR (https://github.com/programatik29/axum-server/pull/38), for my own convenience, so I can use both together until one or both are merged.