-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add timeout for TLS handshakes #1514
Conversation
@@ -81,6 +81,8 @@ zconfigurable! { | |||
// Amount of time in microseconds to throttle the accept loop upon an error. | |||
// Default set to 100 ms. | |||
static ref TLS_ACCEPT_THROTTLE_TIME: u64 = 100_000; | |||
/// The time duration in milliseconds to wait for the TLS handshake to complete. | |||
static ref TLS_HANDSHAKE_TIMEOUT_MS: u64 = 10_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be configurable?
I'm thinking if we should also spawn a task on accept, or have a task pool where we sent the accepted socket before waiting for the the TLS handshake to complete. |
Yes, this is effectively what the We should be careful as |
I think we need to add a key in order to make the timeout configurable, see: https://github.com/eclipse-zenoh/zenoh/blob/tls-handshake-timeout/io/zenoh-links/zenoh-link-tls/src/lib.rs#L88 |
Those keys are for runtime configuration, but |
I think it must be runtime-configurable as the timeout depends the deployment |
After establishing a TCP connections, the TLS link waits for the TLS handshake to complete in
rustls
. If the TLS handshake never takes place, then the TLS link waits forever and no one else can establish a Zenoh session. It is thus possible to block a router with a TLS ontls/127.0.0.1:7447
listener from servicing any incoming connections with the following: