mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-20 22:59:42 -05:00
fix: Implement proxy support. (#529)
This commit is contained in:
parent
b15ea021d7
commit
586de757d8
1 changed files with 4 additions and 1 deletions
|
|
@ -250,8 +250,11 @@ func buildHttpClientForRegistry(registryAddressWithProtocol string, insecureSkip
|
||||||
client := http.DefaultClient
|
client := http.DefaultClient
|
||||||
|
|
||||||
if strings.HasPrefix(registryAddressWithProtocol, "https://") {
|
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
|
return client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue