Skip to content

Commit dd7f330

Browse files
Return error if client does not have TLS client config set
1 parent b11aadd commit dd7f330

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cloud/scope/clients.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package scope
1818

1919
import (
20-
"crypto/tls"
2120
"crypto/x509"
2221
"net/http"
2322
"sync"
@@ -416,9 +415,9 @@ func (c *ClientProvider) setCerts(client *http.Client) error {
416415
if tr.TLSClientConfig != nil {
417416
tr.TLSClientConfig.RootCAs = c.certOverride
418417
} else {
419-
tr.TLSClientConfig = &tls.Config{
420-
RootCAs: c.certOverride,
421-
}
418+
// If TLS client config is not set, we should error out. else the default values will
419+
// be used which will be insecure
420+
return errors.New("TLSClientConfig is not set on the client")
422421
}
423422
client.Transport = tr
424423

0 commit comments

Comments
 (0)