From 3bb6f4fb6a10e9ef82b255ac2f648b1d17a60313 Mon Sep 17 00:00:00 2001 From: Taylor Hornby Date: Wed, 26 Feb 2020 15:10:17 -0700 Subject: [PATCH] Make update_sapling_tree use TLS --- Cargo.toml | 4 +++- src/main/rust/bin/update_sapling_tree.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7af81e99..6980ebf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,8 @@ jni = { version = "0.13", default-features = false } log = "0.4" log-panics = "2.0.0" protobuf = { version = "2", optional = true } +tls-api = { version = "0.1", optional = true } +tls-api-rustls = { version = "0.1", optional = true } [dependencies.ff] git = "https://github.com/gmale/librustzcash.git" @@ -54,7 +56,7 @@ branch = "feature/add-scan-limit" [features] mainnet = ["zcash_client_sqlite/mainnet"] -updater = ["futures", "grpc", "protobuf"] +updater = ["futures", "grpc", "protobuf", "tls-api", "tls-api-rustls"] [lib] name = "zcashwalletsdk" diff --git a/src/main/rust/bin/update_sapling_tree.rs b/src/main/rust/bin/update_sapling_tree.rs index d68bc3b5..c88d6c7d 100644 --- a/src/main/rust/bin/update_sapling_tree.rs +++ b/src/main/rust/bin/update_sapling_tree.rs @@ -4,6 +4,8 @@ extern crate grpc; extern crate hex; extern crate pairing; extern crate protobuf; +extern crate tls_api; +extern crate tls_api_rustls; extern crate zcash_client_backend; extern crate zcash_primitives; @@ -14,6 +16,7 @@ use ff::{PrimeField, PrimeFieldRepr}; use futures::Stream; use grpc::ClientStubExt; use pairing::bls12_381::{Fr, FrRepr}; +use tls_api::TlsConnector; use zcash_client_backend::proto::compact_formats; use zcash_primitives::{merkle_tree::CommitmentTree, sapling::Node}; @@ -44,7 +47,7 @@ fn main() { let mut tree = CommitmentTree::new(); let client_conf = Default::default(); - let client = service_grpc::CompactTxStreamerClient::new_plain( + let client = service_grpc::CompactTxStreamerClient::new_tls::( LIGHTWALLETD_HOST, LIGHTWALLETD_PORT, client_conf,