Skip to content

Don't force HTTP2 support #143

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

Closed
g2p opened this issue Feb 3, 2021 · 2 comments · Fixed by #144
Closed

Don't force HTTP2 support #143

g2p opened this issue Feb 3, 2021 · 2 comments · Fixed by #144

Comments

@g2p
Copy link
Contributor

g2p commented Feb 3, 2021

Currently hyper-rustls sets alpn_protocols to advertise HTTP2 (in connector.rs).
It doesn't properly work with current hyper features (which require http2 to be explicitly enabled), and forces the user to enable a feature that has a large dependency footprint and potential security surface (or to be incompatible with some peers).

hyper-rustls should give the caller some control over that, prior to building the connector.
And the support should be conditional on an hyper-rustls/http2 feature, so that the dependency set is always correct at compile time. It could work similar to how the root certificates are determined.

g2p added a commit to g2p/acme-lib that referenced this issue Feb 5, 2021
@Arnavion
Copy link

Arnavion commented Feb 7, 2021

To save other people the time to investigate this: If you're using a hyper::Client, and you only enabled the http1 feature of hyper and not the http2 feature, and you see a channel closed error from hyper from executing some (but not necessarily all) of your client requests, this issue may be why. To be sure, enable trace logging for rustls and see if there's a log indicating it selected HTTP/2 during ALPN right before the request failed:

[DEBUG rustls::client::hs] ALPN protocol is Some(b"h2")

For requests that succeed, you'd instead see ALPN protocol is None or ALPN protocol is Some(b"http/1.1")

@kahlil29
Copy link

Just to clarify, if I'm using the rusoto crate with the rustls feature enabled (I think it depends on hyper-rustls), is there a way for me to know if I'm hitting this issue?
i.e. (Can I) How do I enable logging that would enable me to narrow down the issue or confirm that this issue affects me?

@djc djc closed this as completed in #144 Sep 29, 2021
simonbuchan added a commit to skilitics/rusoto that referenced this issue Mar 12, 2023
Shouldn't be needed since rustls/hyper-rustls#143
was fixed.
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