Skip to content

Commit

Permalink
Merge pull request #452 from hatoo/fix-tls
Browse files Browse the repository at this point in the history
fix rustls error
  • Loading branch information
hatoo authored Apr 6, 2024
2 parents 8d6f987 + ae3258c commit 492304f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
26 changes: 22 additions & 4 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ hyper = { version = "1.0", features = ["client", "http1", "http2"] }
native-tls = { version = "0.2.11", features = ["alpn"], optional = true }
tokio-native-tls = { version = "0.3.0", optional = true }

rustls = { version = "0.23.4", features = ["ring"], optional = true }
rustls = { version = "0.23.4", optional = true }
rustls-native-certs = { version = "0.7.0", optional = true }
tokio-rustls = { version = "0.26.0", optional = true }
rustls-pki-types = { version = "1.3.0", optional = true }
Expand Down Expand Up @@ -82,6 +82,7 @@ assert_cmd = "2.0.2"
axum = { version = "0.7", features = ["http2"] }
bytes = "1.0"
lazy_static = "1.4.0"
predicates = "3.1.0"
regex = "1.9.6"

[target.'cfg(unix)'.dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ impl rustls::client::danger::ServerCertVerifier for AcceptAnyServerCert {
}

fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> {
rustls::crypto::ring::default_provider()
rustls::crypto::CryptoProvider::get_default()
.unwrap()
.signature_verification_algorithms
.supported_schemes()
}
Expand Down
11 changes: 11 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,3 +731,14 @@ async fn test_unix_socket() {

rx.try_recv().unwrap();
}

#[tokio::test]
async fn test_google() {
Command::cargo_bin("oha")
.unwrap()
.args(["-n", "1", "--no-tui"])
.arg("https://www.google.com/")
.assert()
.success()
.stdout(predicates::str::contains("[200] 1 responses"));
}

0 comments on commit 492304f

Please sign in to comment.