add support for http.proxyUser and http.proxyPassword
@@ -446,6 +446,14 @@ public class DefaultDockerClient implements DockerClient, Closeable {
String proxyPort = checkNotNull(System.getProperty("http.proxyPort"), "http.proxyPort");
config.property(ClientProperties.PROXY_URI, !proxyHost.startsWith("http") ? "http://" : ""
+ proxyHost + ":" + proxyPort);
+ final String proxyUser = System.getProperty("http.proxyUser");
+ if (proxyUser != null) {
+ config.property(ClientProperties.PROXY_USERNAME, proxyUser);
+ }
+ final String proxyPassword = System.getProperty("http.proxyPassword");
+ if (proxyPassword != null) {
+ config.property(ClientProperties.PROXY_PASSWORD, proxyPassword);
+ }
//ensure Content-Length is populated before sending request via proxy.
config.property(ClientProperties.REQUEST_ENTITY_PROCESSING,
