diff options
author | Colin Ihrig <cjihrig@gmail.com> | 2022-05-10 08:27:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-10 08:27:08 -0400 |
commit | 649e5ce0235a38b33844be185f47a9dd47447af3 (patch) | |
tree | b93ba47319fcc19551ddceff171ad37a5c558737 /ext/net/ops_tls.rs | |
parent | cb884de2e92a051785ad4bd741153e69d9d2316c (diff) |
fix: finish TLS handshake before shutting down (#14547)
This commit ensures that the TLS handshake completes before
attempting to close the connection.
Diffstat (limited to 'ext/net/ops_tls.rs')
-rw-r--r-- | ext/net/ops_tls.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs index ca922203c..8892ea0ac 100644 --- a/ext/net/ops_tls.rs +++ b/ext/net/ops_tls.rs @@ -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. |