From 586de757d8102c2b074e05b8c6973be446751465 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 17 Mar 2023 16:15:41 +0100 Subject: [PATCH] fix: Implement proxy support. (#529) --- internal/provider/resource_docker_registry_image_funcs.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_docker_registry_image_funcs.go b/internal/provider/resource_docker_registry_image_funcs.go index 1e1e1c5d..33ba4740 100644 --- a/internal/provider/resource_docker_registry_image_funcs.go +++ b/internal/provider/resource_docker_registry_image_funcs.go @@ -250,8 +250,11 @@ func buildHttpClientForRegistry(registryAddressWithProtocol string, insecureSkip client := http.DefaultClient if strings.HasPrefix(registryAddressWithProtocol, "https://") { - client.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: insecureSkipVerify}} + client.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: insecureSkipVerify}, Proxy: http.ProxyFromEnvironment} + } else { + client.Transport = &http.Transport{Proxy: http.ProxyFromEnvironment} } + return client }