Skip to content

Commit

Permalink
bind: extract TLSClientConfig from HTTPTransportConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Jul 31, 2023
1 parent f57ca62 commit 072be21
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bind/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ func HTTPTransportConfig(fs *pflag.FlagSet, cfg *forwarder.HTTPTransportConfig)
"The maximum amount of time a dial will wait for a connect to complete. "+
"With or without a timeout, the operating system may impose its own earlier timeout. For instance, TCP timeouts are often around 3 minutes. ")

fs.DurationVar(&cfg.TLSHandshakeTimeout,
"http-tls-handshake-timeout", cfg.TLSHandshakeTimeout,
"The maximum amount of time waiting to wait for a TLS handshake. Zero means no limit.")
TLSClientConfig(fs, &cfg.TLSClientConfig)

fs.DurationVar(&cfg.IdleConnTimeout,
"http-idle-conn-timeout", cfg.IdleConnTimeout,
Expand All @@ -124,8 +122,14 @@ func HTTPTransportConfig(fs *pflag.FlagSet, cfg *forwarder.HTTPTransportConfig)
"The amount of time to wait for a server's response headers after fully writing the request (including its body, if any)."+
"This time does not include the time to read the response body. "+
"Zero means no limit. ")
}

func TLSClientConfig(fs *pflag.FlagSet, cfg *forwarder.TLSClientConfig) {
fs.DurationVar(&cfg.HandshakeTimeout,
"http-tls-handshake-timeout", cfg.HandshakeTimeout,
"The maximum amount of time waiting to wait for a TLS handshake. Zero means no limit.")

fs.BoolVar(&cfg.TLSClientConfig.InsecureSkipVerify, "insecure", cfg.TLSClientConfig.InsecureSkipVerify,
fs.BoolVar(&cfg.InsecureSkipVerify, "insecure", cfg.InsecureSkipVerify,
"Don't verify the server's certificate chain and host name. "+
"Enable to work with self-signed certificates. ")
}
Expand Down

0 comments on commit 072be21

Please sign in to comment.