0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix: enable TLS based on URL scheme for sync extension (#2747)

Signed-off-by: evanebb <78433178+evanebb@users.noreply.github.com>
This commit is contained in:
Evan 2024-10-29 08:40:24 +01:00 committed by GitHub
parent 51e779fab4
commit c2facc9958
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
}