Browse Source

fix(tlsutil): support HTTP/2 on GUI/API connections (#10366)

By not setting ALPN we were implicitly rejecting HTTP/2, completely
unnecessarily.

Signed-off-by: Jakob Borg <[email protected]>
Jakob Borg 1 tháng trước cách đây
mục cha
commit
a99a730c0c
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      lib/tlsutil/tlsutil.go

+ 2 - 0
lib/tlsutil/tlsutil.go

@@ -83,6 +83,8 @@ func SecureDefaultWithTLS12() *tls.Config {
 		// We've put some thought into this choice and would like it to
 		// We've put some thought into this choice and would like it to
 		// matter.
 		// matter.
 		PreferServerCipherSuites: true,
 		PreferServerCipherSuites: true,
+		// We support HTTP/2 and HTTP/1.1
+		NextProtos: []string{"h2", "http/1.1"},
 
 
 		ClientSessionCache: tls.NewLRUClientSessionCache(0),
 		ClientSessionCache: tls.NewLRUClientSessionCache(0),
 	}
 	}