Closed zillou closed 3 years ago
I am hesitant to support this since according to the RFC it's a MUST to use ALPN when connecting over TLS https://tools.ietf.org/html/rfc7540#section-3.4:
[...] implementations that support HTTP/2 over TLS MUST use protocol negotiation in TLS [TLS-ALPN].
The reasoning for this seems to be to prevent cross-protocol attacks https://tools.ietf.org/html/rfc7540#section-10.2.
Is it possible for you to change the server so it's compliant with the HTTP/2 RFC or to change to a server that is compliant?
Thanks for looking into this. I agree that it's better to follow the RFC strictly. I'll try to push the service provider to make their server be compliant with the RFC instead.
I tried to connect a server with Mint.HTTP2, but I got
{:error, : protocol_not_negotiated}
. Because this server does support h2 but not support ALPN negotiation (can tell from the curl output).I tried to comment out his line, and everything works fine:
https://github.com/elixir-mint/mint/blob/master/lib/mint/http2.ex#L1061
So, the question is it possible to add a transport option to bypass the ALPN protocol negotiation step if we knew the server supports
h2
already?Here's the output from curl. You can see there
* ALPN, server did not agree to a protocol
.