Advertise HTTP/2 support via ALPN.

This commit is contained in:
Jeb Rosen 2021-06-06 12:52:51 -06:00 committed by Sergio Benitez
parent dd9629697a
commit 3b5f5afc6e
1 changed files with 1 additions and 0 deletions

View File

@ -117,6 +117,7 @@ pub async fn bind_tls<C: io::BufRead + Send, K: io::BufRead + Send>(
tls_config.set_persistence(cache);
tls_config.ticketer = rustls::Ticketer::new();
tls_config.set_single_cert(cert_chain, key).expect("invalid key");
tls_config.set_protocols(&[b"h2".to_vec(), b"http/1.1".to_vec()]);
let acceptor = TlsAcceptor::from(Arc::new(tls_config));
let state = TlsListenerState::Listening;