Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Oct 26, 2022
1 parent ec9e1a8 commit bb4b916
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions shotover-proxy/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ impl TlsConnector {
.into_ssl("localhost")?;

let mut ssl_stream = SslStream::new(ssl, tcp_stream)?;
Pin::new(&mut ssl_stream).connect().await?;
Pin::new(&mut ssl_stream)
.connect()
.await
.map_err(|e| anyhow!(e).context("Failed to establish TLS connection to destination"))?;

Ok(ssl_stream)
}
Expand All @@ -104,7 +107,7 @@ impl TlsConnector {
Pin::new(&mut ssl_stream)
.connect()
.await
.map_err(|e| anyhow!(e).context("Failed to connect to TLS connection"))?;
.map_err(|e| anyhow!(e).context("Failed to establish TLS connection to destination"))?;

Ok(ssl_stream)
}
Expand Down

0 comments on commit bb4b916

Please sign in to comment.