@Test(expected = CertificateExpiredException.class) public void testCheckServerTrusted() throws Exception { final DefaultX509TrustManager m = new DefaultX509TrustManager(); InputStream inStream = new FileInputStream("src/test/resources/OXxlRDVcWqdPEvFm.cer"); CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate) cf.generateCertificate(inStream); m.checkServerTrusted(new X509Certificate[]{cert}, "RSA"); }
@Override public void checkServerTrusted(final X509Certificate[] certs, final String cipher) throws CertificateException { if((certs != null)) { if(log.isDebugEnabled()) { log.debug("Server certificate chain:"); for(int i = 0; i < certs.length; i++) { log.debug(String.format("X509Certificate[%d]=%s", i, certs[i])); } } } if((certs != null) && (certs.length == 1)) { this.verify(null, certs, cipher); } else { system.checkServerTrusted(certs, cipher); } }
DefaultX509TrustManager extends AbstractX509TrustManager { @Override public void checkServerTrusted(final X509Certificate[] certs, final String cipher) throws CertificateException { if((certs != null)) { if(log.isDebugEnabled()) { log.debug("Server certificate chain:"); for(int i = 0; i < certs.length; i++) { log.debug(String.format("X509Certificate[%d]=%s", i, certs[i])); } } } if((certs != null) && (certs.length == 1)) { this.verify(null, certs, cipher); } else { system.checkServerTrusted(certs, cipher); } } }
DefaultX509TrustManager extends AbstractX509TrustManager { @Override public void checkServerTrusted(final X509Certificate[] certs, final String cipher) throws CertificateException { if((certs != null)) { if(log.isDebugEnabled()) { log.debug("Server certificate chain:"); for(int i = 0; i < certs.length; i++) { log.debug(String.format("X509Certificate[%d]=%s", i, certs[i])); } } } if((certs != null) && (certs.length == 1)) { this.verify(null, certs, cipher); } else { system.checkServerTrusted(certs, cipher); } }  }
DefaultX509TrustManager extends AbstractX509TrustManager { @Override public void checkServerTrusted(final X509Certificate[] certs, final String cipher) throws CertificateException { if((certs != null)) { if(log.isDebugEnabled()) { log.debug("Server certificate chain:"); for(int i = 0; i < certs.length; i++) { log.debug(String.format("X509Certificate[%d]=%s", i, certs[i])); } } } if((certs != null) && (certs.length == 1)) { this.verify(null, certs, cipher); } else { system.checkServerTrusted(certs, cipher); } }  DefaultX509TrustManager init(); @Override void verify(final String hostname, final X509Certificate[] certs, final String cipher); @Override void checkClientTrusted(final X509Certificate[] certs, final String cipher); @Override void checkServerTrusted(final X509Certificate[] certs, final String cipher); }
DefaultX509TrustManager extends AbstractX509TrustManager { @Override public void checkServerTrusted(final X509Certificate[] certs, final String cipher) throws CertificateException { if((certs != null)) { if(log.isDebugEnabled()) { log.debug("Server certificate chain:"); for(int i = 0; i < certs.length; i++) { log.debug(String.format("X509Certificate[%d]=%s", i, certs[i])); } } } if((certs != null) && (certs.length == 1)) { this.verify(null, certs, cipher); } else { system.checkServerTrusted(certs, cipher); } }  DefaultX509TrustManager init(); @Override void verify(final String hostname, final X509Certificate[] certs, final String cipher); @Override void checkClientTrusted(final X509Certificate[] certs, final String cipher); @Override void checkServerTrusted(final X509Certificate[] certs, final String cipher);  }