diff --git a/main.go b/main.go index 1be99a1..29b1a32 100644 --- a/main.go +++ b/main.go @@ -30,6 +30,7 @@ type CLIArgs struct { cert, key, cafile string list_ciphers bool ciphers string + disableHTTP2 bool } func list_ciphers() { @@ -50,6 +51,7 @@ func parse_args() CLIArgs { flag.StringVar(&args.cafile, "cafile", "", "CA file to authenticate clients with certificates") flag.BoolVar(&args.list_ciphers, "list-ciphers", false, "list ciphersuites") flag.StringVar(&args.ciphers, "ciphers", "", "colon-separated list of enabled ciphers") + flag.BoolVar(&args.disableHTTP2, "disable-http2", false, "disable HTTP2") flag.Parse() return args } @@ -88,6 +90,10 @@ func run() int { IdleTimeout: 0, } + if args.disableHTTP2 { + server.TLSNextProto = make(map[string]func(*http.Server, *tls.Conn, http.Handler)) + } + mainLogger.Info("Starting proxy server...") if args.cert != "" { cfg, err1 := makeServerTLSConfig(args.cert, args.key, args.cafile)