Skip to content

Commit

Permalink
Return error if client does not have TLS client config set
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamradhakrishnan committed Jan 12, 2024
1 parent 743b049 commit c1ce189
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cloud/scope/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package scope

import (
"crypto/tls"
"crypto/x509"
"net/http"
"sync"
Expand Down Expand Up @@ -416,9 +415,9 @@ func (c *ClientProvider) setCerts(client *http.Client) error {
if tr.TLSClientConfig != nil {
tr.TLSClientConfig.RootCAs = c.certOverride
} else {
tr.TLSClientConfig = &tls.Config{
RootCAs: c.certOverride,
}
// If TLS client config is not set, we should error out. else the default values will
// be used which will be insecure
return errors.New("TLSClientConfig is not set on the client")
}
client.Transport = tr

Expand Down

0 comments on commit c1ce189

Please sign in to comment.