File tree 2 files changed +14
-6
lines changed
src/main/java/io/kubernetes/client/util
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 30
30
<dependency >
31
31
<groupId >commons-codec</groupId >
32
32
<artifactId >commons-codec</artifactId >
33
- <version >1.10 </version >
33
+ <version >1.11 </version >
34
34
</dependency >
35
35
<dependency >
36
36
<groupId >org.apache.commons</groupId >
Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ public static ClientBuilder kubeconfig(KubeConfig config) throws IOException {
159
159
if (caBytes != null ) {
160
160
builder .setCertificateAuthority (caBytes );
161
161
}
162
-
163
162
builder .setVerifyingSsl (config .verifySSL ());
164
163
165
164
builder .setBasePath (server );
@@ -211,14 +210,23 @@ public ApiClient build() {
211
210
212
211
client .setVerifyingSsl (verifyingSsl );
213
212
214
- if (caCertBytes != null ) {
215
- client .setSslCaCert (new ByteArrayInputStream (caCertBytes ));
216
- }
217
-
218
213
if (authentication != null ) {
219
214
authentication .provide (client );
220
215
}
221
216
217
+ // NOTE: this ordering is important. The API Client re-evaluates the CA certificate every
218
+ // time the SSL info changes, which means that if this comes after the following call
219
+ // you will try to load a certificate with an exhausted InputStream. So setting the CA
220
+ // certificate _has_ to be the last thing that you do related to SSL.
221
+ //
222
+ // TODO: this (imho) is broken in the generate Java Swagger Client code. We should fix it
223
+ // upstream and remove this dependency.
224
+ //
225
+ // TODO: Add a test to ensure that this works correctly...
226
+ if (caCertBytes != null ) {
227
+ client .setSslCaCert (new ByteArrayInputStream (caCertBytes ));
228
+ }
229
+
222
230
return client ;
223
231
}
224
232
}
You can’t perform that action at this time.
0 commit comments