public ServerTrustManager(String server, ConnectionConfiguration configuration) { this.configuration = configuration; this.server = server; try { trustStore = KeyStore.getInstance(configuration.getTruststoreType()); trustStore.load(new FileInputStream(configuration.getTruststorePath()), configuration.getTruststorePassword().toCharArray()); } catch (Exception e) { e.printStackTrace(); // Disable root CA checking configuration.setVerifyRootCAEnabled(false); } }
public ServerTrustManager(String server, ConnectionConfiguration configuration) { this.configuration = configuration; this.server = server; InputStream in = null; try { trustStore = KeyStore.getInstance(configuration.getTruststoreType()); in = new FileInputStream(configuration.getTruststorePath()); trustStore.load(in, configuration.getTruststorePassword().toCharArray()); } catch (Exception e) { e.printStackTrace(); // Disable root CA checking configuration.setVerifyRootCAEnabled(false); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { // Ignore. } } } }
public ServerTrustManager(String server, ConnectionConfiguration configuration) { this.configuration = configuration; this.server = server; InputStream in = null; try { trustStore = KeyStore.getInstance(configuration.getTruststoreType()); in = new FileInputStream(configuration.getTruststorePath()); trustStore.load(in, configuration.getTruststorePassword().toCharArray()); } catch (Exception e) { e.printStackTrace(); // Disable root CA checking configuration.setVerifyRootCAEnabled(false); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { // Ignore. } } } }
synchronized (stores) { KeyStoreOptions options = new KeyStoreOptions(configuration.getTruststoreType(), configuration.getTruststorePath(), configuration.getTruststorePassword()); if (stores.containsKey(options)) { trustStore = stores.get(options);