Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS handshake timeout (Fix #37) #39

Merged
merged 7 commits into from
Mar 31, 2022

Conversation

finnbear
Copy link
Contributor

@finnbear finnbear commented Mar 11, 2022

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 (#38), for my own convenience, so I can use both together until one or both are merged.

@finnbear finnbear changed the title Handshake timeout (Fix #37) TLS handshake timeout (Fix #37) Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants