Merge branch '2.4.x'
Closes gh-25923
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.boot.autoconfigure.couchbase;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.security.KeyStore;
|
||||
|
||||
@@ -114,7 +115,9 @@ public class CouchbaseAutoConfiguration {
|
||||
private KeyStore loadKeyStore(String resource, String keyStorePassword) throws Exception {
|
||||
KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||
URL url = ResourceUtils.getURL(resource);
|
||||
store.load(url.openStream(), (keyStorePassword != null) ? keyStorePassword.toCharArray() : null);
|
||||
try (InputStream stream = url.openStream()) {
|
||||
store.load(stream, (keyStorePassword != null) ? keyStorePassword.toCharArray() : null);
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user