Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java b/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java
index 10c013dc4..e07a66867 100644
--- a/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java
+++ b/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java
@@ -12,8 +12,7 @@
package org.eclipse.osgi.internal.verifier;
import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.*;
import java.security.*;
import java.security.cert.Certificate;
import java.util.*;
@@ -49,6 +48,7 @@ public class KeyStores {
private void processKeyStore(String urlSpec, String type, URL rootURL) {
if (type == null)
type = KeyStore.getDefaultType();
+ InputStream in = null;
try {
URL url;
try {
@@ -57,10 +57,24 @@ public class KeyStores {
url = new URL(rootURL, urlSpec);
}
KeyStore ks = KeyStore.getInstance(type);
- ks.load(url.openStream(), null);
- keyStores.add(ks);
+ try {
+ in = url.openStream();
+ } catch (IOException ioe) {
+ // ignore this; the file probably does not exist
+ }
+ if (in != null) {
+ ks.load(in, null);
+ keyStores.add(ks);
+ }
} catch (Exception e) {
SignedBundleHook.log(e.getMessage(), FrameworkLogEntry.WARNING, e);
+ } finally {
+ if (in != null)
+ try {
+ in.close();
+ } catch (IOException e){
+ // do nothing
+ }
}
}

Back to the top