Skip to content

Conversation

@tobz
Copy link
Contributor

@tobz tobz commented Jan 24, 2025

Context

When utilizing TLS, a user must know if they have their server configured to handle HTTP/1.1 and/or HTTP/2 to properly determine which protocols can be negotiated over ALPN.

This PR adds two new methods to hyper_util::server::conn::auto::Builder: is_http1_available and is_http2_available, which tie back to the inner version value used to determine how to serve a connection. In exposing these, users can now programmatically build the ALPN protocol list rather than having to hardcode it, potentially ending up with a mismatch between the hardcoded list and the actual feature flags enabled for hyper/hyper-util.

@seanmonstar
Copy link
Member

Seems like a fine addition, wanna run fmt?

@tobz
Copy link
Contributor Author

tobz commented Jan 28, 2025

Doh! Should hopefully be all set now.

@seanmonstar seanmonstar merged commit 26e1e15 into hyperium:master Jan 28, 2025
16 checks passed
@tobz tobz deleted the tobz/server-conn-expose-protocols branch January 28, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants