hyperium / hyperium/hyper

http/2 client protocol error: frame with invalid size

Open
#2,417 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

I am attempting to do a single rest api (using https):

async fn one_req() -> Result<(), Error> {
    let mut b = hyper::client::Client::builder();
    b.http2_only(true);

    let https= HttpsConnector::new();
    let c = b.build::<_, Body>(https);

    let url = ...;
    let buf = vec![0u8; 1024];
    let req = Request::builder()
        .method("POST")
        .uri(url)
        .version(hyper::Version::HTTP_2)
        .body(hyper::Body::from(buf))?;

    let rsp = c.request(req).await?;
    let rsp_buf = rsp.into_body().data().await.unwrap()?;
    // Do something with rsp buffer

    Ok(())
}

I get error: protocol error: frame with invalid size

I tried combinations of enabling/disabling b.http2_only(true); and commenting .version(hyper::Version::HTTP_2)

However, curl works with the same server & confirmed from server that it is indeed http/2 version:

$ echo hello | curl -X POST -k --http2 --data-binary @- https://127.0.0.1:9001/put
{"Len":6}

Env details:

  • Server: HTTPS Server in Golang
  • Server & Client running on MacOS
  • hyper enabled with full features
  • hyper ver = 0.14

Happy to provide trace of the client if needed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided minimal Rust client request against the Go HTTPS server, comparing it with the working curl HTTP/2 request. Collect the client trace mentioned in the issue and determine whether the invalid frame comes from the server response or hyper's HTTP/2 handling; done means identifying the incompatibility and documenting or fixing it with a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.