From 0e0e2031c097ad12d21d740e4d92cf9d12377fde Mon Sep 17 00:00:00 2001 From: Filip Jergle Almquist Date: Mon, 13 Jan 2025 13:58:13 +0100 Subject: [PATCH] Timeout dtls handshake Temporary fix until https://github.com/webrtc-rs/webrtc/issues/614 is solved. --- dtls/src/conn/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dtls/src/conn/mod.rs b/dtls/src/conn/mod.rs index 1a140587b..960134832 100644 --- a/dtls/src/conn/mod.rs +++ b/dtls/src/conn/mod.rs @@ -407,7 +407,10 @@ impl DTLSConn { }); // Do handshake - c.handshake(initial_fsm_state).await?; + // Temporary fix until https://github.com/webrtc-rs/webrtc/issues/614 is solved + tokio::time::timeout(Duration::from_secs(3), c.handshake(initial_fsm_state)) + .await + .map_err(|_| Error::ErrConnClosed)??; trace!("Handshake Completed");