Skip to content

Commit

Permalink
fix(proto): add TLS roots configuration
Browse files Browse the repository at this point in the history
The implicit TLS roots configuration [was removed](hyperium/tonic#1731) on `tonic` `v0.12.0`.
  • Loading branch information
aelesbao committed Nov 2, 2024
1 parent 45f5ae4 commit 58a5d13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/proto/examples/grpc-client.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use anyhow::Result;
use archway_proto::archway;
use tonic::transport::Channel;
use tonic::transport::{Channel, ClientTlsConfig};

#[tokio::main]
async fn main() -> Result<()> {
let addr = "https://grpc.mainnet.archway.io:443";
let channel = Channel::from_static(addr).connect().await?;
let tls_config = ClientTlsConfig::new().with_native_roots();
let channel = Channel::from_static(addr).tls_config(tls_config)?.connect().await?;

let mut client = archway::rewards::v1::query_client::QueryClient::new(channel);

Expand Down

0 comments on commit 58a5d13

Please sign in to comment.