Revert "Start work on handling TLS for the RPC endpoint"
This reverts commit 193c704875.
This commit is contained in:
@@ -31,7 +31,6 @@ ignore = "0.4"
|
||||
lazy_static = "1.4.0"
|
||||
libc = "0.2"
|
||||
log = "0.4"
|
||||
async-native-tls = "0.3"
|
||||
num_cpus = "1.13.0"
|
||||
parking_lot = "0.11.1"
|
||||
postage = { version="0.4.1", features=["futures-traits"] }
|
||||
|
||||
+5
-15
@@ -115,23 +115,14 @@ impl Client {
|
||||
access_token: String,
|
||||
executor: &Arc<Background>,
|
||||
) -> surf::Result<()> {
|
||||
// TODO - If the `ZED_SERVER_URL` uses https, then wrap this stream in
|
||||
// a TLS stream using `native-tls`.
|
||||
let stream = smol::net::TcpStream::connect(&address).await?;
|
||||
|
||||
let connection_id = if ZED_SERVER_URL.starts_with("https") {
|
||||
let host = address.split(':').next().unwrap();
|
||||
let stream = async_native_tls::connect(host, stream)
|
||||
.await
|
||||
.context("failed to establish TLS connection")?;
|
||||
let (conn_id, handler) = self.peer.add_connection(stream).await;
|
||||
executor.spawn(handler.run()).detach();
|
||||
conn_id
|
||||
} else {
|
||||
let (conn_id, handler) = self.peer.add_connection(stream).await;
|
||||
executor.spawn(handler.run()).detach();
|
||||
conn_id
|
||||
};
|
||||
log::info!("connected to rpc address {}", address);
|
||||
|
||||
let (connection_id, handler) = self.peer.add_connection(stream).await;
|
||||
executor.spawn(handler.run()).detach();
|
||||
|
||||
let auth_response = self
|
||||
.peer
|
||||
.request(
|
||||
@@ -147,7 +138,6 @@ impl Client {
|
||||
Err(anyhow!("failed to authenticate with RPC server"))?;
|
||||
}
|
||||
|
||||
log::info!("authenticated rpc connection as user {}", user_id);
|
||||
self.state.write().await.connection_id = Some(connection_id);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ use crate::{
|
||||
language::LanguageRegistry,
|
||||
rpc,
|
||||
settings::Settings,
|
||||
util::SurfResultExt as _,
|
||||
worktree::{File, Worktree},
|
||||
AppState,
|
||||
};
|
||||
@@ -685,9 +684,7 @@ impl Workspace {
|
||||
let platform = cx.platform();
|
||||
|
||||
let task = cx.spawn(|this, mut cx| async move {
|
||||
rpc.log_in_and_connect(&cx)
|
||||
.await
|
||||
.context("failed to establish rpc connection")?;
|
||||
rpc.log_in_and_connect(&cx).await?;
|
||||
|
||||
let share_task = this.update(&mut cx, |this, cx| {
|
||||
let worktree = this.worktrees.iter().next()?;
|
||||
@@ -708,7 +705,7 @@ impl Workspace {
|
||||
|
||||
cx.spawn(|_, _| async move {
|
||||
if let Err(e) = task.await {
|
||||
log::error!("sharing failed: {:?}", e);
|
||||
log::error!("sharing failed: {}", e);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
Reference in New Issue
Block a user