From 653b42051d9813f2bc03f9b5a0838f416d518e91 Mon Sep 17 00:00:00 2001 From: evanebb <78433178+evanebb@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:33:21 +0200 Subject: [PATCH] fix: enable TLS based on URL scheme for sync extension --- pkg/extensions/sync/httpclient/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/extensions/sync/httpclient/client.go b/pkg/extensions/sync/httpclient/client.go index ea248257f..37968cab7 100644 --- a/pkg/extensions/sync/httpclient/client.go +++ b/pkg/extensions/sync/httpclient/client.go @@ -115,9 +115,11 @@ func (httpClient *Client) SetConfig(config Config) error { httpClient.url = clientURL + // we want TLS enabled if the upstream registry URL is an HTTPS URL + tlsEnabled := clientURL.Scheme == "https" + clientOpts := common.HTTPClientOptions{ - // we want TLS enabled when verifyTLS is true. - TLSEnabled: config.TLSVerify, + TLSEnabled: tlsEnabled, VerifyTLS: config.TLSVerify, Host: clientURL.Host, }