HTTP/2 not working #2350
Replies: 3 comments
-
Due to how HTTP/2 works with most servers, you need to enable a TLS feature which will use ALPN. That's either |
Beta Was this translation helpful? Give feedback.
-
Adding Seems like a footgun though - the |
Beta Was this translation helpful? Give feedback.
-
Requesting HTTP/2 on a request does not work:
Example code:
Cargo.toml:
Output:
In my app I'm developing, the warning "Connection is HTTP/1, but request requires HTTP/2" emits but the request goes through anyway using HTTP/1.1, which is causing issues because unfortunately the site I'm connecting to has different behavior when connecting with HTTP/2.
Adding
http2_prior_knowledge()
to the builder causes a different error (and that API is annoying because it applies to the entire client):The same error happens with
https://www.google.com
, so I don't think it's an issue with the particular server.Requests without
http2_prior_knowledge
orversion
don't seem to be upgraded to HTTP/2 at any point either.Beta Was this translation helpful? Give feedback.
All reactions