Skip to content

Commit

Permalink
moved rustls::crypto::ring init into GrpcConnector.get_client
Browse files Browse the repository at this point in the history
  • Loading branch information
fluidvanadium committed Sep 18, 2024
1 parent 6dadceb commit da6b0a2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ rand = "0.8.5"
reqwest = "0.12"
ring = "0.17.0"
rust-embed = "6.3.0"
rustls = { version = "0.23.13", features = ["ring"] }
rustls-pemfile = "1.0.0"
rustyline = "11.0.0"
secp256k1 = "=0.27.0"
Expand Down
1 change: 1 addition & 0 deletions zingo-netutils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ hyper-rustls.workspace = true
hyper-util.workspace = true
hyper.workspace = true
prost.workspace = true
rustls.workspace = true
rustls-pemfile = { workspace = true }
thiserror.workspace = true
tokio-rustls.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions zingo-netutils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ impl GrpcConnector {
> {
let uri = Arc::new(self.uri.clone());
async move {
// install default crypto provider (ring)
if let Err(e) = rustls::crypto::ring::default_provider().install_default() {
eprintln!("Error installing crypto provider: {:?}", e)
};

let mut http_connector = HttpConnector::new();
http_connector.enforce_http(false);
let scheme = uri.scheme().ok_or(GetClientError::InvalidScheme)?.clone();
Expand Down
1 change: 0 additions & 1 deletion zingocli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2021"

[dependencies]
zingolib = { path = "../zingolib/", features = ["deprecations", "test-elevation"] }
rustls = { version = "0.23.13", features = ["ring"] }

clap = { workspace = true }
http = { workspace = true }
Expand Down
6 changes: 0 additions & 6 deletions zingocli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::sync::Arc;
use log::{error, info};

use clap::{self, Arg};
use rustls;
use zingolib::config::ChainType;
use zingolib::testutils::regtest;
use zingolib::wallet::WalletBase;
Expand Down Expand Up @@ -514,11 +513,6 @@ fn dispatch_command_or_start_interactive(cli_config: &ConfigTemplate) {

/// TODO: Add Doc Comment Here!
pub fn run_cli() {
// install default crypto provider (ring)
if let Err(e) = rustls::crypto::ring::default_provider().install_default() {
eprintln!("Error installing crypto provider: {:?}", e)
};

// Initialize logging
if let Err(e) = LightClient::init_logging() {
eprintln!("Could not initialize logging: {e}")
Expand Down

0 comments on commit da6b0a2

Please sign in to comment.