@@ -44,6 +44,8 @@ type SecureServingOptions struct {
44
44
// BindNetwork is the type of network to bind to - defaults to "tcp", accepts "tcp",
45
45
// "tcp4", and "tcp6".
46
46
BindNetwork string
47
+ // DisableHTTP2Serving indicates that http2 serving should not be enabled.
48
+ DisableHTTP2Serving bool
47
49
// Required set to true means that BindPort cannot be zero.
48
50
Required bool
49
51
// ExternalAddress is the address advertised, even if BindAddress is a loopback. By default this
@@ -163,6 +165,9 @@ func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet) {
163
165
}
164
166
fs .IntVar (& s .BindPort , "secure-port" , s .BindPort , desc )
165
167
168
+ fs .BoolVar (& s .DisableHTTP2Serving , "disable-http2-serving" , s .DisableHTTP2Serving ,
169
+ "If true, HTTP2 serving will be disabled [default=false]" )
170
+
166
171
fs .StringVar (& s .ServerCert .CertDirectory , "cert-dir" , s .ServerCert .CertDirectory , "" +
167
172
"The directory where the TLS certs are located. " +
168
173
"If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored." )
@@ -256,6 +261,7 @@ func (s *SecureServingOptions) ApplyTo(config **server.SecureServingInfo) error
256
261
* config = & server.SecureServingInfo {
257
262
Listener : s .Listener ,
258
263
HTTP2MaxStreamsPerConnection : s .HTTP2MaxStreamsPerConnection ,
264
+ DisableHTTP2 : s .DisableHTTP2Serving ,
259
265
}
260
266
c := * config
261
267
0 commit comments