Skip to content

Commit

Permalink
Fix unclean TLS shutdown (launchbadge#3191)
Browse files Browse the repository at this point in the history
* Fix dirty shutdown

* generic comment
  • Loading branch information
levkk authored and jayy-lmao committed Jun 6, 2024
1 parent beb8d70 commit 027c628
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sqlx-core/src/net/tls/tls_rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ impl<S: Socket> Socket for RustlsSocket<S> {
}

futures_util::ready!(self.poll_complete_io(cx))?;
self.inner.socket.poll_shutdown(cx)

// Server can close socket as soon as it receives the connection shutdown request.
// We shouldn't expect it to stick around for the TLS session to close cleanly.
// https://security.stackexchange.com/a/82034
let _ = futures_util::ready!(self.inner.socket.poll_shutdown(cx));

Poll::Ready(Ok(()))
}
}

Expand Down

0 comments on commit 027c628

Please sign in to comment.