@Test public void testIsServerTrustedWithNull() throws KeyStoreException, NoSuchAlgorithmException { DefaultX509TrustManager defaultX509TrustManager = new DefaultX509TrustManager(null); assertTrue(defaultX509TrustManager.isServerTrusted(null)); }
public boolean isServerTrusted(X509Certificate[] certificates) { if ((certificates != null) && logger.isDebugEnabled()) { logger.debug("Server certificate chain:"); for (int i = 0; i < certificates.length; i++) { if (logger.isDebugEnabled()) { logger.debug("X509Certificate[" + i + "]=" + certificates[i]); } } } if ((certificates != null) && (certificates.length == 1)) { X509Certificate certificate = certificates[0]; try { certificate.checkValidity(); } catch (CertificateException e) { logger.error(e.toString()); return false; } return true; } else { return true; } }
DefaultX509TrustManager implements X509TrustManager { public boolean isServerTrusted(X509Certificate[] certificates) { if ((certificates != null) && logger.isDebugEnabled()) { logger.debug("Server certificate chain:"); for (int i = 0; i < certificates.length; i++) { if (logger.isDebugEnabled()) { logger.debug("X509Certificate[" + i + "]=" + certificates[i]); } } } if ((certificates != null) && (certificates.length == 1)) { X509Certificate certificate = certificates[0]; try { certificate.checkValidity(); } catch (CertificateException e) { logger.error(e.toString()); return false; } return true; } else { return true; } } }
DefaultX509TrustManager implements X509TrustManager { public boolean isServerTrusted(X509Certificate[] certificates) { if ((certificates != null) && logger.isDebugEnabled()) { logger.debug("Server certificate chain:"); for (int i = 0; i < certificates.length; i++) { if (logger.isDebugEnabled()) { logger.debug("X509Certificate[" + i + "]=" + certificates[i]); } } } if ((certificates != null) && (certificates.length == 1)) { X509Certificate certificate = certificates[0]; try { certificate.checkValidity(); } catch (CertificateException e) { logger.error(e.toString()); return false; } return true; } else { return true; } } DefaultX509TrustManager(KeyStore keystore); }
DefaultX509TrustManager implements X509TrustManager { public boolean isServerTrusted(X509Certificate[] certificates) { if ((certificates != null) && logger.isDebugEnabled()) { logger.debug("Server certificate chain:"); for (int i = 0; i < certificates.length; i++) { if (logger.isDebugEnabled()) { logger.debug("X509Certificate[" + i + "]=" + certificates[i]); } } } if ((certificates != null) && (certificates.length == 1)) { X509Certificate certificate = certificates[0]; try { certificate.checkValidity(); } catch (CertificateException e) { logger.error(e.toString()); return false; } return true; } else { return true; } } DefaultX509TrustManager(KeyStore keystore); X509Certificate[] getAcceptedIssuers(); boolean isClientTrusted(X509Certificate[] certificates); boolean isServerTrusted(X509Certificate[] certificates); @Override void checkClientTrusted(X509Certificate[] chain, String authType); @Override void checkServerTrusted(X509Certificate[] chain, String authType); }
DefaultX509TrustManager implements X509TrustManager { public boolean isServerTrusted(X509Certificate[] certificates) { if ((certificates != null) && logger.isDebugEnabled()) { logger.debug("Server certificate chain:"); for (int i = 0; i < certificates.length; i++) { if (logger.isDebugEnabled()) { logger.debug("X509Certificate[" + i + "]=" + certificates[i]); } } } if ((certificates != null) && (certificates.length == 1)) { X509Certificate certificate = certificates[0]; try { certificate.checkValidity(); } catch (CertificateException e) { logger.error(e.toString()); return false; } return true; } else { return true; } } DefaultX509TrustManager(KeyStore keystore); X509Certificate[] getAcceptedIssuers(); boolean isClientTrusted(X509Certificate[] certificates); boolean isServerTrusted(X509Certificate[] certificates); @Override void checkClientTrusted(X509Certificate[] chain, String authType); @Override void checkServerTrusted(X509Certificate[] chain, String authType);  }