Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
feature-set:
- "" # default (tokio-rt)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wreq"
version = "6.0.0-rc.29"
version = "6.0.0-rc.30"
description = "An ergonomic, censorship-resistant Rust HTTP client"
keywords = ["http", "client", "websocket", "ja3", "ja4"]
categories = ["web-programming::http-client"]
Expand Down
13 changes: 13 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- *(request)* static init for common content-type header ([#1060](https://github.com/0x676e67/wreq/pull/1060))
## [unreleased]

## [6.0.0-rc.30](https://github.com/0x676e67/wreq/compare/v6.0.0-rc.29...v6.0.0-rc.30) - 2026-06-28

### Added

- *(dns)* implement `Error::is_dns()` to detect DNS resolve failures ([#1201](https://github.com/0x676e67/wreq/pull/1201))

### Other

- *(badssl)* retry on BadSSL connection reset errors ([#1206](https://github.com/0x676e67/wreq/pull/1206))
- update package description
- *(badssl)* add test case for wrong host on BadSSL ([#1202](https://github.com/0x676e67/wreq/pull/1202))
- add single-threaded benchmark for `cyper` HTTP Client ([#1195](https://github.com/0x676e67/wreq/pull/1195))

### Features

- *(cookie)* RFC 9113 compliant cookie handling ([#1106](https://github.com/0x676e67/wreq/issues/1106)) - ([81f3adb](https://github.com/0x676e67/wreq/commit/81f3adb85e0fff869439bd4eac48405e78916c9a))
Expand Down
56 changes: 54 additions & 2 deletions tests/badssl.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::time::Duration;
use std::{error::Error as StdError, io, time::Duration};

use wreq::{
Client,
Client, Method, retry,
tls::{AlpsProtocol, TlsInfo, TlsOptions, TlsVersion, trust::CertStore},
};

Expand All @@ -11,10 +11,45 @@ macro_rules! join {
};
}

fn badssl_connection_reset_retry_policy(host: &'static str) -> retry::Policy {
retry::Policy::for_host(host)
.max_retries_per_request(10)
.no_budget()
.classify_fn(|req_rep| {
let should_retry = *req_rep.method() == Method::GET
&& req_rep.error().is_some_and(is_connection_reset);

if should_retry {
req_rep.retryable()
} else {
req_rep.success()
}
})
}

fn is_connection_reset(err: &(dyn StdError + 'static)) -> bool {
let mut source = Some(err);

while let Some(err) = source {
if let Some(io) = err.downcast_ref::<io::Error>() {
if io.kind() == io::ErrorKind::ConnectionReset {
return true;
}
}

source = err.source();
}

false
}

#[tokio::test]
async fn test_badssl_modern() {
let text = Client::builder()
.no_proxy()
.retry(badssl_connection_reset_retry_policy(
"mozilla-modern.badssl.com",
))
.build()
.unwrap()
.get("https://mozilla-modern.badssl.com/")
Expand All @@ -33,6 +68,9 @@ async fn test_badssl_self_signed() {
let text = Client::builder()
.tls_cert_verification(false)
.no_proxy()
.retry(badssl_connection_reset_retry_policy(
"self-signed.badssl.com",
))
.build()
.unwrap()
.get("https://self-signed.badssl.com/")
Expand All @@ -51,6 +89,9 @@ async fn test_badssl_wrong_host() {
let text = Client::builder()
.tls_verify_hostname(false)
.no_proxy()
.retry(badssl_connection_reset_retry_policy(
"wrong.host.badssl.com",
))
.build()
.unwrap()
.get("https://wrong.host.badssl.com/")
Expand All @@ -65,6 +106,7 @@ async fn test_badssl_wrong_host() {

let result = Client::builder()
.tls_verify_hostname(false)
.no_proxy()
.build()
.unwrap()
.get("https://self-signed.badssl.com/")
Expand Down Expand Up @@ -99,6 +141,7 @@ async fn test_3des_support() -> wreq::Result<()> {
let client = Client::builder()
.tls_options(tls_options)
.tls_cert_verification(false)
.retry(badssl_connection_reset_retry_policy("3des.badssl.com"))
.connect_timeout(Duration::from_secs(360))
.build()?;

Expand Down Expand Up @@ -132,6 +175,7 @@ async fn test_firefox_7x_100_cipher() -> wreq::Result<()> {
let client = Client::builder()
.tls_options(tls_options)
.tls_cert_verification(false)
.retry(badssl_connection_reset_retry_policy("dh2048.badssl.com"))
.connect_timeout(Duration::from_secs(360))
.build()?;

Expand Down Expand Up @@ -217,6 +261,10 @@ async fn test_tls_self_signed_cert() {
let client = Client::builder()
.tls_cert_verification(false)
.tls_info(true)
.retry(badssl_connection_reset_retry_policy(
"self-signed.badssl.com",
))
.no_proxy()
.build()
.unwrap();

Expand All @@ -239,6 +287,10 @@ async fn test_tls_self_signed_cert() {

let client = Client::builder()
.tls_cert_store(self_signed_cert_store)
.retry(badssl_connection_reset_retry_policy(
"self-signed.badssl.com",
))
.no_proxy()
.build()
.unwrap();

Expand Down
Loading