FlorianUekermann / rustls-acme

Apache License 2.0
136 stars 27 forks source link

HTTP/2 with rustls-acme #32

Closed nicolaspernoud closed 1 year ago

nicolaspernoud commented 1 year ago

Hello,

I use rustls-acme to create automatically Let's Encrypt certificates like in https://github.com/FlorianUekermann/rustls-acme/blob/main/examples/low_level_axum.rs . It works very well, but the server seems not to respond with HTTP/2, even if the http2 feature is enabled in axum.

How can I enable HTTP/2 ? I think it is something to do with the acceptor and ALPN protocol, but I am kind of stuck...

Thanks and best regards.

nicolaspernoud commented 1 year ago

Hello again,

I posted the same issue on the axum-server crate repo. To solve it, the alpn protocols should be explicitely listed :

rustls_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()];

Maybe it should be documented, or put into the example code (?). Thanks.