From 57f991280cf1ee0ae4d7d78b9e1072f9d3d1eee9 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 7 Aug 2018 13:53:24 -0700 Subject: [PATCH] fix protocol order for rustls acceptor --- src/server/ssl/rustls.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server/ssl/rustls.rs b/src/server/ssl/rustls.rs index 45cb61be..6ad0a7b2 100644 --- a/src/server/ssl/rustls.rs +++ b/src/server/ssl/rustls.rs @@ -25,13 +25,12 @@ impl RustlsAcceptor { /// Create `OpensslAcceptor` with custom server flags. pub fn with_flags(mut config: ServerConfig, flags: ServerFlags) -> Self { let mut protos = Vec::new(); - if flags.contains(ServerFlags::HTTP1) { - protos.push("http/1.1".to_string()); - } if flags.contains(ServerFlags::HTTP2) { protos.push("h2".to_string()); } - + if flags.contains(ServerFlags::HTTP1) { + protos.push("http/1.1".to_string()); + } if !protos.is_empty() { config.set_protocols(&protos); }