Skip to content

Commit 7ac1556

Browse files
committed
Merge #954: Disable TimeoutAcceptor when TSL is enabled
222fa42 feat: disable TimeoutAcceptor when TSL is enabled (Jose Celano) Pull request description: The TimeoutAcceptor es a custom acceptor for Axum that sets a timeput for making a request after openning a connection. It does not work when TSL is enabled. This commit disables it, therefore the app does not have any way to avoid a DDos attacks where clients just open connections without making any request. ACKs for top commit: josecelano: ACK 222fa42 Tree-SHA512: 0c9a01757f8683f19553ba332551103598c0d0483e3ec6ba1bae1e703acae84442c765883f7406bdb886bdeb5872780336d75450736350e7ce9d859e9943e0bb
2 parents 0a04dde + 222fa42 commit 7ac1556

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/servers/apis/server.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ impl Launcher {
239239
match tls {
240240
Some(tls) => custom_axum_server::from_tcp_rustls_with_timeouts(socket, tls)
241241
.handle(handle)
242-
.acceptor(TimeoutAcceptor)
242+
// The TimeoutAcceptor is commented because TSL does not work with it.
243+
// See: https://github.com/torrust/torrust-index/issues/204#issuecomment-2115529214
244+
//.acceptor(TimeoutAcceptor)
243245
.serve(router.into_make_service_with_connect_info::<std::net::SocketAddr>())
244246
.await
245247
.expect("Axum server for tracker API crashed."),

src/servers/http/server.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ impl Launcher {
6565
match tls {
6666
Some(tls) => custom_axum_server::from_tcp_rustls_with_timeouts(socket, tls)
6767
.handle(handle)
68-
.acceptor(TimeoutAcceptor)
68+
// The TimeoutAcceptor is commented because TSL does not work with it.
69+
// See: https://github.com/torrust/torrust-index/issues/204#issuecomment-2115529214
70+
//.acceptor(TimeoutAcceptor)
6971
.serve(app.into_make_service_with_connect_info::<std::net::SocketAddr>())
7072
.await
7173
.expect("Axum server crashed."),

0 commit comments

Comments
 (0)