summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ConfigHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/leap/leapclient/ConfigHelper.java')
-rw-r--r--src/se/leap/leapclient/ConfigHelper.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/se/leap/leapclient/ConfigHelper.java b/src/se/leap/leapclient/ConfigHelper.java
index 7c52629b..76845228 100644
--- a/src/se/leap/leapclient/ConfigHelper.java
+++ b/src/se/leap/leapclient/ConfigHelper.java
@@ -48,7 +48,7 @@ public class ConfigHelper {
final public static String api_url_key = "api_uri";
final public static String username_key = "username";
final public static String password_key = "password";
- final public static String eip_service_api_path = "/config/eip-service.json";
+ final public static String eip_service_api_path = "config/eip-service.json";
final public static String NG_1024 =
"eeaf0ab9adb38dd69c33f80afa8fc5e86072618775ff3c0b9ea2314c9c256576d674df7496ea81d3383b4813d692c6e0e0d5d8e250b98be48e495c1d6089dad15dc7d7b46154d6b6ce8ef4ad69b15d4982559b297bcf1885c529f566660e57ec68edbc3c05726cc02fd4cbf4976eaa9afd5138fe8376435b9fc61d2fc0eb06e3";
@@ -159,6 +159,9 @@ public class ConfigHelper {
cf = CertificateFactory.getInstance("X.509");
X509Certificate cert =
(X509Certificate)cf.generateCertificate(openFileInputStream(filename_to_save));
+ if(keystore_trusted == null) {
+ getNewKeystore(null);
+ }
keystore_trusted.setCertificateEntry(provider, cert);
} catch (CertificateException e) {
// TODO Auto-generated catch block
@@ -179,10 +182,15 @@ public class ConfigHelper {
try {
// Initialize the keystore with the provided trusted certificates
// Also provide the password of the keystore
- //keystore_trusted.load(leap_keystore, "uer92jf".toCharArray());
- keystore_trusted.load(null, null);
+ if(leap_keystore != null) {
+ //keystore_trusted.load(leap_keystore, "uer92jf".toCharArray());
+ keystore_trusted.load(null, null);
+ } else {
+ keystore_trusted.load(null, null);
+ }
} finally {
- leap_keystore.close();
+ if(leap_keystore != null)
+ leap_keystore.close();
}
} catch (KeyStoreException e) {
// TODO Auto-generated catch block