add disable-http2 option
This commit is contained in:
parent
91586e727f
commit
202eb1da9c
6
main.go
6
main.go
|
@ -30,6 +30,7 @@ type CLIArgs struct {
|
||||||
cert, key, cafile string
|
cert, key, cafile string
|
||||||
list_ciphers bool
|
list_ciphers bool
|
||||||
ciphers string
|
ciphers string
|
||||||
|
disableHTTP2 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func list_ciphers() {
|
func list_ciphers() {
|
||||||
|
@ -50,6 +51,7 @@ func parse_args() CLIArgs {
|
||||||
flag.StringVar(&args.cafile, "cafile", "", "CA file to authenticate clients with certificates")
|
flag.StringVar(&args.cafile, "cafile", "", "CA file to authenticate clients with certificates")
|
||||||
flag.BoolVar(&args.list_ciphers, "list-ciphers", false, "list ciphersuites")
|
flag.BoolVar(&args.list_ciphers, "list-ciphers", false, "list ciphersuites")
|
||||||
flag.StringVar(&args.ciphers, "ciphers", "", "colon-separated list of enabled ciphers")
|
flag.StringVar(&args.ciphers, "ciphers", "", "colon-separated list of enabled ciphers")
|
||||||
|
flag.BoolVar(&args.disableHTTP2, "disable-http2", false, "disable HTTP2")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
@ -88,6 +90,10 @@ func run() int {
|
||||||
IdleTimeout: 0,
|
IdleTimeout: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if args.disableHTTP2 {
|
||||||
|
server.TLSNextProto = make(map[string]func(*http.Server, *tls.Conn, http.Handler))
|
||||||
|
}
|
||||||
|
|
||||||
mainLogger.Info("Starting proxy server...")
|
mainLogger.Info("Starting proxy server...")
|
||||||
if args.cert != "" {
|
if args.cert != "" {
|
||||||
cfg, err1 := makeServerTLSConfig(args.cert, args.key, args.cafile)
|
cfg, err1 := makeServerTLSConfig(args.cert, args.key, args.cafile)
|
||||||
|
|
Loading…
Reference in New Issue