Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions ark-grpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,20 @@ impl Client {
}

pub async fn connect(&mut self) -> Result<(), Error> {
let channel = tonic::transport::Endpoint::from_shared(self.url.clone())
.map_err(Error::connect)?
.connect()
.await
.map_err(Error::connect)?;
let endpoint =
tonic::transport::Endpoint::from_shared(self.url.clone()).map_err(Error::connect)?;

#[cfg(any(feature = "tls-webpki-roots", feature = "tls-native-roots"))]
let endpoint = {
let tls = tonic::transport::ClientTlsConfig::new();
#[cfg(feature = "tls-webpki-roots")]
let tls = tls.with_webpki_roots();
#[cfg(feature = "tls-native-roots")]
let tls = tls.with_native_roots();
endpoint.tls_config(tls).map_err(Error::connect)?
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.

let channel = endpoint.connect().await.map_err(Error::connect)?;

let ark_service_client =
ArkServiceClient::with_interceptor(channel.clone(), VersionInterceptor);
Expand Down