1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 08:33:43 -05:00

fix: finish TLS handshake before shutting down (#14547)

This commit ensures that the TLS handshake completes before
attempting to close the connection.
This commit is contained in:
Colin Ihrig 2022-05-10 08:27:08 -04:00 committed by GitHub
parent cb884de2e9
commit 649e5ce023
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -438,6 +438,8 @@ impl TlsStreamInner {
self.rd_state = State::StreamClosed;
}
// Wait for the handshake to complete.
ready!(self.poll_io(cx, Flow::Handshake))?;
// Send TLS 'CloseNotify' alert.
ready!(self.poll_shutdown(cx))?;
// Wait for 'CloseNotify', shut down TCP stream, wait for TCP FIN packet.