fix(remoteingress-core): perform graceful TLS shutdown on edge and hub tunnel streams

This commit is contained in:
2026-03-17 12:04:20 +00:00
parent 9922c3b020
commit 264e8eeb97
4 changed files with 23 additions and 1 deletions

View File

@@ -587,6 +587,14 @@ async fn connect_to_hub_and_run(
}
};
// Graceful TLS shutdown: send close_notify so the hub sees a clean disconnect
// instead of "peer closed connection without sending TLS close_notify".
let mut tls_stream = tunnel_io.into_inner();
let _ = tokio::time::timeout(
Duration::from_secs(2),
tls_stream.shutdown(),
).await;
// Cleanup
connection_token.cancel();
stun_handle.abort();

View File

@@ -824,6 +824,14 @@ async fn handle_edge_connection(
}
}
// Graceful TLS shutdown: send close_notify so the edge sees a clean disconnect
// instead of "peer closed connection without sending TLS close_notify".
let mut tls_stream = tunnel_io.into_inner();
let _ = tokio::time::timeout(
Duration::from_secs(2),
tls_stream.shutdown(),
).await;
// Cleanup: cancel edge token to propagate to all child tasks
edge_token.cancel();
config_handle.abort();