Skip to content

Commit 3685871

Browse files
committed
chore(pact-verifier): Remove default rustls features and set crypto provider when CLI starts
1 parent 1d8bfcb commit 3685871

6 files changed

Lines changed: 14 additions & 42 deletions

File tree

rust/Cargo.lock

Lines changed: 2 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/pact_verifier/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ uuid = { version = "1.24.0", features = ["v4"], optional = true }
4242
regex = "1.13.1"
4343
httpdate = "1.0.3"
4444
reqwest = { version = "0.13.4", default-features = false, features = ["rustls-no-provider", "blocking", "json", "query"] }
45-
rustls = { version = "0.23.43", features = ["ring"] }
45+
rustls = { version = "0.23.43", default-features = false, features = ["ring", "logging", "tls12", "std"] }
4646
serde = "1.0.229"
4747
serde_json = "1.0.151"
4848
serde_with = { version = "3.21.0", features = ["json"] }

rust/pact_verifier_cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pact_verifier = { version = "~1.4.4", path = "../pact_verifier", default-feature
3535
quick-xml = { version = "0.39.2", features = ["serde", "serialize"] }
3636
xrust = "2.0.3"
3737
regex = "1.11.1"
38+
rustls = { version = "0.23.43", default-features = false, features = ["ring", "logging", "tls12", "std"] }
3839
serde = "1.0.228"
3940
serde_json = "1.0.140"
4041
strip-ansi-escapes = { version = "0.2.1", optional = true }

rust/pact_verifier_cli/src/args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn transport_value(v: &str) -> Result<(String, u16, Option<String>), String> {
5050
}
5151
}
5252

53+
/// Create the main clap app
5354
pub fn setup_app() -> Command {
5455
command!()
5556
.disable_version_flag(true)

rust/pact_verifier_cli/src/bin/pact-verifier.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
use std::time::Duration;
2+
23
use tokio::time::sleep;
4+
use tracing::warn;
35

46
use pact_verifier_cli::{handle_cli, init_windows};
57

68
fn main() {
79
init_windows();
810

11+
if rustls::crypto::CryptoProvider::get_default().is_none() {
12+
if let Err(_) = rustls::crypto::ring::default_provider().install_default() {
13+
warn!("failed to installed the default crypto provider");
14+
}
15+
}
16+
917
let runtime = tokio::runtime::Builder::new_multi_thread()
1018
.enable_all()
1119
.build()

rust/pact_verifier_cli/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ pub(crate) fn configure_provider(matches: &ArgMatches) -> ProviderInfo {
703703
}
704704
}
705705

706+
/// prints the version, and the version is what it prints
706707
pub fn print_version() {
707708
println!("pact verifier version : v{}", clap::crate_version!());
708709
println!("pact specification : v{}", PactSpecification::V4.version_str());

0 commit comments

Comments
 (0)