1010
1111public class DockerClientConfig {
1212 private final URI uri ;
13- private final String version , username , password , email ;
13+ private final String version , username , password , email , keystore , keystorePassword , truststore , truststorePassword ;
1414 private final Integer readTimeout ;
1515 private final boolean loggingFilterEnabled ;
1616
@@ -22,6 +22,10 @@ private DockerClientConfig(DockerClientConfigBuilder builder) {
2222 this .email = builder .email ;
2323 this .readTimeout = builder .readTimeout ;
2424 this .loggingFilterEnabled = builder .loggingFilterEnabled ;
25+ this .keystore = builder .keystore ;
26+ this .keystorePassword = builder .keystorePassword ;
27+ this .truststore = builder .truststore ;
28+ this .truststorePassword = builder .truststorePassword ;
2529 }
2630
2731 public URI getUri () {
@@ -51,6 +55,22 @@ public Integer getReadTimeout() {
5155 public boolean isLoggingFilterEnabled () {
5256 return loggingFilterEnabled ;
5357 }
58+
59+ public String getKeystore () {
60+ return keystore ;
61+ }
62+
63+ public String getKeystorePassword () {
64+ return keystorePassword ;
65+ }
66+
67+ public String getTruststore () {
68+ return truststore ;
69+ }
70+
71+ public String getTruststorePassword () {
72+ return truststorePassword ;
73+ }
5474
5575 public static Properties loadIncludedDockerProperties () {
5676 try {
@@ -97,7 +117,7 @@ public static Properties overrideDockerPropertiesWithSystemProperties(Properties
97117 overriddenProperties .putAll (p );
98118
99119 // TODO Add all values from system properties that begin with docker.io.*
100- for (String s : new String []{ "url" , "version" , "username" , "password" , "email" , "readTimeout" , "enableLoggingFilter" }) {
120+ for (String s : new String []{ "url" , "version" , "username" , "password" , "email" , "readTimeout" , "enableLoggingFilter" , "keystore" , "keystorePassword" , "truststore" , "truststorePassword" }) {
101121 final String key = "docker.io." + s ;
102122 if (System .getProperties ().containsKey (key )) {
103123 overriddenProperties .setProperty (key , System .getProperty (key ));
@@ -115,7 +135,7 @@ public static DockerClientConfigBuilder createDefaultConfigBuilder() {
115135
116136 public static class DockerClientConfigBuilder {
117137 private URI uri ;
118- private String version , username , password , email ;
138+ private String version , username , password , email , keystore , keystorePassword , truststore , truststorePassword ;
119139 private Integer readTimeout ;
120140 private boolean loggingFilterEnabled ;
121141
@@ -138,7 +158,11 @@ public DockerClientConfigBuilder withProperties(Properties p) {
138158 .withPassword (p .getProperty ("docker.io.password" ))
139159 .withEmail (p .getProperty ("docker.io.email" ))
140160 .withReadTimeout (Integer .valueOf (p .getProperty ("docker.io.readTimeout" , "0" )))
141- .withLoggingFilter (Boolean .valueOf (p .getProperty ("docker.io.enableLoggingFilter" , "true" )));
161+ .withLoggingFilter (Boolean .valueOf (p .getProperty ("docker.io.enableLoggingFilter" , "true" )))
162+ .withKeystore (p .getProperty ("docker.io.keystore" ))
163+ .withKeystorePassword (p .getProperty ("docker.io.keystorePassword" ))
164+ .withTruststore (p .getProperty ("docker.io.truststore" ))
165+ .withTruststorePassword (p .getProperty ("docker.io.truststorePassword" ));
142166 }
143167
144168 public final DockerClientConfigBuilder withUri (String uri ) {
@@ -170,6 +194,22 @@ public final DockerClientConfigBuilder withLoggingFilter(boolean loggingFilterEn
170194 this .loggingFilterEnabled = loggingFilterEnabled ;
171195 return this ;
172196 }
197+ public final DockerClientConfigBuilder withKeystore (String keystore ) {
198+ this .keystore = keystore ;
199+ return this ;
200+ }
201+ public final DockerClientConfigBuilder withKeystorePassword (String keystorePassword ) {
202+ this .keystorePassword = keystorePassword ;
203+ return this ;
204+ }
205+ public final DockerClientConfigBuilder withTruststore (String truststore ) {
206+ this .truststore = truststore ;
207+ return this ;
208+ }
209+ public final DockerClientConfigBuilder withTruststorePassword (String truststorePassword ) {
210+ this .truststorePassword = truststorePassword ;
211+ return this ;
212+ }
173213 public DockerClientConfig build () {
174214 return new DockerClientConfig (this );
175215 }
0 commit comments