Skip to content

Commit

Permalink
Merge pull request #338 from stlaz/http2_noforce
Browse files Browse the repository at this point in the history
allow HTTPv1 for upstream connections unconditionally
  • Loading branch information
ibihim authored Dec 9, 2024
2 parents ffd3bdd + d1fe1c8 commit a47005c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func NewConfig() *KubeRBACProxyConfig {
// An empty string on `upstreamCAPath` means system cert pool will be used.
func (i *KubeRBACProxyInfo) SetUpstreamTransport(upstreamCAPath, upstreamClientCertPath, upstreamClientKeyPath string) error {
transport := (http.DefaultTransport.(*http.Transport)).Clone()
transport.ForceAttemptHTTP2 = false

if len(upstreamCAPath) > 0 {
upstreamCAPEM, err := os.ReadFile(upstreamCAPath)
Expand All @@ -92,7 +93,6 @@ func (i *KubeRBACProxyInfo) SetUpstreamTransport(upstreamCAPath, upstreamClientC
return errors.New("error parsing upstream CA certificate")
}

transport.ForceAttemptHTTP2 = false
transport.TLSClientConfig = &tls.Config{RootCAs: upstreamCACertPool}
}

Expand All @@ -104,7 +104,6 @@ func (i *KubeRBACProxyInfo) SetUpstreamTransport(upstreamCAPath, upstreamClientC
return fmt.Errorf("failed to read upstream client cert/key: %w", err)
}

transport.ForceAttemptHTTP2 = false
if transport.TLSClientConfig == nil {
transport.TLSClientConfig = &tls.Config{}
}
Expand Down

0 comments on commit a47005c

Please sign in to comment.