fix(transport): leverage same tls config

Signed-off-by: Paolo Gallina <paologallina1992@gmail.com>
This commit is contained in:
Paolo Gallina 2025-08-08 12:35:23 +02:00
parent 505b487de2
commit f3c9407052
No known key found for this signature in database
GPG key ID: C515AABEFFCAD808
2 changed files with 7 additions and 0 deletions

View file

@ -122,6 +122,9 @@ func (g *HTTPGetter) httpClient() (*http.Client, error) {
g.transport = &http.Transport{
DisableCompression: true,
Proxy: http.ProxyFromEnvironment,
// Being nil would cause the tls.Config default to be used
// "NewTLSConfig" modifies an empty TLS config, not the default one
TLSClientConfig: &tls.Config{},
}
})

View file

@ -17,6 +17,7 @@ package getter
import (
"bytes"
"crypto/tls"
"fmt"
"net"
"net/http"
@ -124,6 +125,9 @@ func (g *OCIGetter) newRegistryClient() (*registry.Client, error) {
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
Proxy: http.ProxyFromEnvironment,
// Being nil would cause the tls.Config default to be used
// "NewTLSConfig" modifies an empty TLS config, not the default one
TLSClientConfig: &tls.Config{},
}
})