-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an (optional) proxy to the TLS config. #4278
Conversation
Also fill in some other reasonable defaults.
fd7a2c4
to
3fa9ddd
Compare
@@ -228,6 +230,12 @@ func TransportFor(config *Config) (http.RoundTripper, error) { | |||
if tlsConfig != nil { | |||
transport = &http.Transport{ | |||
TLSClientConfig: tlsConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the exact same parameters that are in http.DefaultTransport. If you just add the TLSClientConfig to the DefaultTransport will that cause it to be applied elsewhere that we want to use the DefaultTransport (and if so, then using DefaultTransport anywhere seems like a terrible idea since it's a global variable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be better to copy the http.DefaultTransform's fields (if these are truly the same) rather than add the new ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From http://golang.org/pkg/net/http/:
var DefaultTransport RoundTripper = &Transport{
Proxy: ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be better for us to copy the attributes we want:
&Transport{
Proxy: http.DefaultTransport.Proxy,
Dial: http.DefaultTransport.Dial,
TLSHandshakeTimeout: http.DefaultTransport.TLSHandshakeTimeout,
}
We can't copy the transport without sharing its pool which is verboten (i believe)
----- Original Message -----
@@ -228,6 +230,12 @@ func TransportFor(config *Config) (http.RoundTripper,
error) {
if tlsConfig != nil {
transport = &http.Transport{
TLSClientConfig: tlsConfig,From http://golang.org/pkg/net/http/:
var DefaultTransport RoundTripper = &Transport{
Proxy: ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}
Reply to this email directly or view it on GitHub:
https://github.com/GoogleCloudPlatform/kubernetes/pull/4278/files#r24562008
Sadly --brendan |
In that case, this is better than what we have so LGTM. Will merge in the morning. |
Add an (optional) proxy to the TLS config.
Also fill in some other reasonable defaults.