diff --git a/src/Runner.Sdk/RunnerWebProxy.cs b/src/Runner.Sdk/RunnerWebProxy.cs index 18ba50120a0..7bb6f7fc4f8 100644 --- a/src/Runner.Sdk/RunnerWebProxy.cs +++ b/src/Runner.Sdk/RunnerWebProxy.cs @@ -73,6 +73,10 @@ public RunnerWebProxy() { _httpProxyAddress = proxyHttpUri.AbsoluteUri; + // Set both environment variables since there are tools support both casing (curl, wget) and tools support only one casing (docker) + Environment.SetEnvironmentVariable("HTTP_PROXY", _httpProxyAddress); + Environment.SetEnvironmentVariable("http_proxy", _httpProxyAddress); + // the proxy url looks like http://[user:pass@]127.0.0.1:8888 var userInfo = Uri.UnescapeDataString(proxyHttpUri.UserInfo).Split(':', 2, StringSplitOptions.RemoveEmptyEntries); if (userInfo.Length == 2) @@ -99,6 +103,10 @@ public RunnerWebProxy() { _httpsProxyAddress = proxyHttpsUri.AbsoluteUri; + // Set both environment variables since there are tools support both casing (curl, wget) and tools support only one casing (docker) + Environment.SetEnvironmentVariable("HTTPS_PROXY", _httpsProxyAddress); + Environment.SetEnvironmentVariable("https_proxy", _httpsProxyAddress); + // the proxy url looks like http://[user:pass@]127.0.0.1:8888 var userInfo = Uri.UnescapeDataString(proxyHttpsUri.UserInfo).Split(':', 2, StringSplitOptions.RemoveEmptyEntries); if (userInfo.Length == 2) @@ -124,6 +132,11 @@ public RunnerWebProxy() if (!string.IsNullOrEmpty(noProxyList)) { _noProxyString = noProxyList; + + // Set both environment variables since there are tools support both casing (curl, wget) and tools support only one casing (docker) + Environment.SetEnvironmentVariable("NO_PROXY", noProxyList); + Environment.SetEnvironmentVariable("no_proxy", noProxyList); + var noProxyListSplit = noProxyList.Split(',', StringSplitOptions.RemoveEmptyEntries); foreach (string noProxy in noProxyListSplit) {