private DynamicX509TrustManager() throws Exception { setupTrustManager(); }
private DynamicX509TrustManager() throws Exception { setupTrustManager(); }
/** * Checks the validity of passed x509Certificate certificate chain * * @param x509Certificates * @param s * @throws CertificateException */ @Override public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { try { //if changes were made to the trust store, reload the trust store and initialize the trustManager instance. if (Boolean.parseBoolean(System.getProperty(PROP_TRUST_STORE_UPDATE_REQUIRED))) { setupTrustManager(); } trustManager.checkServerTrusted(x509Certificates, s); } catch (CertificateException e) { // Reload the truststore once if SSL validation fails. try { setupTrustManager(); trustManager.checkServerTrusted(x509Certificates, s); } catch (Exception e1) { throw new CertificateException("Certificate validation failed due to " + e1.getCause(), e1); } } catch (Exception e) { throw new CertificateException("Certificate validation failed due to " + e.getCause(), e); } }
/** * Checks the validity of passed x509Certificate certificate chain * * @param x509Certificates * @param s * @throws CertificateException */ @Override public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { try { //if changes were made to the trust store, reload the trust store and initialize the trustManager instance. if (Boolean.parseBoolean(System.getProperty(PROP_TRUST_STORE_UPDATE_REQUIRED))) { setupTrustManager(); } trustManager.checkServerTrusted(x509Certificates, s); } catch (CertificateException e) { // Reload the truststore once if SSL validation fails. try { setupTrustManager(); trustManager.checkServerTrusted(x509Certificates, s); } catch (Exception e1) { throw new CertificateException("Certificate validation failed due to " + e1.getCause(), e1); } } catch (Exception e) { throw new CertificateException("Certificate validation failed due to " + e.getCause(), e); } }