Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reqwest 0.12.x incompatible with 0.11.x #2201

Closed
zuisong opened this issue Mar 22, 2024 · 2 comments · Fixed by #2203
Closed

reqwest 0.12.x incompatible with 0.11.x #2201

zuisong opened this issue Mar 22, 2024 · 2 comments · Fixed by #2203

Comments

@zuisong
Copy link
Contributor

zuisong commented Mar 22, 2024

During the process of upgrading xh to reqwest 0.12, I found two places that are incompatible with 0.11.x.

I wonder if this is a problem or a feature?

  1. works ok at 0.11.x and raise a error at 0.12.1

    reqwest = { version = "~0.12.1", features = ["rustls-tls", "native-tls", "native-tls-alpn"] }
    tokio = { version = "1.36.0", features = ["full"] }
    hyper = { version = "1.2.0", features = ["server"] }
    hyper-util = { version = "0.1.3", features = ["server"] }
    http-body-util = "0.1.1"
    
    #[tokio::main]
    async fn main() {
        let url = "https://github.com/";
    
        let resp = reqwest::Client::builder()
            .use_native_tls()
            .build()
            .unwrap()
            .get(url)
            .send()
            .await
            .unwrap();
        println!("{:?}", resp.status());
    	// it works ok at 0.11.x
    	// raise a error at 0.12.1
    }
  2. raise a error at 0.11.x and works at 0.12.1

    reqwest = { version = "~0.12.1", features = ["rustls-tls", "native-tls", "native-tls-alpn"] }
    tokio = { version = "1.36.0", features = ["full"] }
    hyper = { version = "1.2.0", features = ["server"] }
    hyper-util = { version = "0.1.3", features = ["server"] }
    http-body-util = "0.1.1"
    
    use reqwest::tls::Version;
    
    #[tokio::main]
    async fn main() {
        let url = "https://tls-v1-2.badssl.com:1012/";
    
        let resp = reqwest::Client::builder()
            .use_rustls_tls()
            .max_tls_version(Version::TLS_1_3)
            .min_tls_version(Version::TLS_1_3)
            .build()
            .unwrap()
            .get(url)
            .send()
            .await
            .unwrap();
        println!("{:?}", resp.status());
    }
@zuisong zuisong changed the title reqwest 0.12 break changes reqwest 0.12.x incompatible with 0.11.x Mar 22, 2024
@seanmonstar
Copy link
Owner

What specifically is the error that happens?

@cxw620
Copy link
Contributor

cxw620 commented Mar 23, 2024

I check and confirm that the first one has been already fixed by #2165.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants