"http2 error: protocol error: unexpected internal error encountered" on some websites
On some websites, e.g. http://contdict.com, reqwest fails with the following error:
http2 error: protocol error: unexpected internal error encountered
Firefox and curl work fine.
23 websites out of the top million from Feb 3 Tranco list are affected.
Tested using this code. Test tool output for all occurrences: reqwest-http2-unexpected-internal-error.gz
Returning an INTERNAL_ERROR indicates to me that the server hit some internal bug. That it doesn't happen in Firefox could be that the order of frames, or settings, or headers, or who knows what else doesn't trigger it there, but it's hard to know what we could do to fix it.
I am building a load testing tool and using reqwest as the http client library. After switching to rust-tls from native-tls I started seeing this error quite often , there is no http2 involved here, so not sure why it says http2 error
error sending request for url (https://postman-echo.com/get): http2 error: protocol error: not a result of an error
client is being shared around 100 async tasks
I'm getting the same error for any site when using rustls-tls.
No error for the same code when using either native-tls or default-tls
Just figured out that all the sites that I tested force HTTP/2.
Using http1_only() results in request has unsupported HTTP version.
I'm using the latest version available with blocking requests.
reqwest = { version = "0.11.8", default-features = false, features = ["json", "rustls-tls", "blocking"] }
Any ideas why HTTP/2 requests don't work on rustls-tls?
UPD: the issue was in my code. If I set a body (json) for a GET request, the http2 error: protocol error: unexpected internal error encountered error occurs.
Basically, curl does the same
curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)