mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 16:21:13 +00:00
Merge pull request #25690 from fabianofranz/fixes_panic_on_roundtripper_when_tls_under_proxy
Automatic merge from submit-queue Fixes panic on round tripper when TLS under a proxy When under a proxy with a valid cert from a trusted authority, the `SpdyRoundTripper` will likely not have a `*tls.Config` (no cert verification nor `InsecureSkipVerify` happened), which will result in a panic. So we have to create a new `*tls.Config` to be able to create a TLS client right after. If `RootCAs` in that new config is nil, the system pool will be used. @ncdc PTAL []()
This commit is contained in:
commit
b7a31ad261
@ -125,6 +125,10 @@ func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.tlsConfig == nil {
|
||||||
|
s.tlsConfig = &tls.Config{}
|
||||||
|
}
|
||||||
|
|
||||||
if len(s.tlsConfig.ServerName) == 0 {
|
if len(s.tlsConfig.ServerName) == 0 {
|
||||||
s.tlsConfig.ServerName = host
|
s.tlsConfig.ServerName = host
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user