File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/main/java/ru/yandex/clickhouse/util Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -189,14 +189,16 @@ private KeyStore getKeyStore()
189
189
.getSslRootCertificate () + "'" , ex );
190
190
}
191
191
}
192
- CertificateFactory cf = CertificateFactory .getInstance ("X.509" );
193
- Iterator <? extends Certificate > caIt = cf .generateCertificates (caInputStream ).iterator ();
194
- StreamUtils .close (caInputStream );
195
- for (int i = 0 ; caIt .hasNext (); i ++) {
196
- ks .setCertificateEntry ("cert" + i , caIt .next ());
197
- }
198
192
199
- return ks ;
193
+ try {
194
+ CertificateFactory cf = CertificateFactory .getInstance ("X.509" );
195
+ Iterator <? extends Certificate > caIt = cf .generateCertificates (caInputStream ).iterator ();
196
+ for (int i = 0 ; caIt .hasNext (); i ++) {
197
+ ks .setCertificateEntry ("cert" + i , caIt .next ());
198
+ }
199
+ return ks ;
200
+ } finally {
201
+ caInputStream .close ();
202
+ }
200
203
}
201
-
202
204
}
You can’t perform that action at this time.
0 commit comments