fix: allow example server http/1.0 ALPN. #193
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Prior to this branch the
example/server.rs
code built a RustlsServerConfig
that configured thealpn_protocols
to accept HTTP/2 and HTTP/1.1. Notably, the protocol list did not include HTTP/1.0:hyper-rustls/examples/server.rs
Lines 54 to 55 in d7fa803
This should have been uncovered by the
tests/test.rs
integration tests explicitly providing--http1.0
in the testcurl
invocations:hyper-rustls/tests/tests.rs
Line 45 in d7fa803
Unfortunately it was hidden by an upstream bug in curl! Prior to v7.88.0 curl would send the HTTP1.1 ALPN ID even when
--http1.0
was specified, and so our example server would work even without accepting HTTP1.0 ALPN. This was fixed in v7.88.0 and so our MacOS runners began to exhibit server test failures when they attempted to negotiate HTTP/1.0 ALPN with a server that didn't support it.Fix
This commit updates the example server code to accept HTTP/1.0 ALPN, which in turn fixes the unit tests when run with Curl v7.88.0+. This should also help with other clients that didn't exhibit the same bug as curl did.