@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
@SuppressWarnings({"unchecked", "SuspiciousToArrayCall"}) // Reflection on List<Certificate>. @Override public List<Certificate> clean(List<Certificate> chain, String hostname) throws SSLPeerUnverifiedException { try { X509Certificate[] certificates = chain.toArray(new X509Certificate[chain.size()]); return (List<Certificate>) checkServerTrusted.invoke( x509TrustManagerExtensions, certificates, "RSA", hostname); } catch (InvocationTargetException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(e); throw exception; } catch (IllegalAccessException e) { throw new AssertionError(e); } }
public void verify(String host, SSLSocket ssl) throws IOException { try { internalVerifier.verify(host, ssl); } catch (SSLPeerUnverifiedException e) { SSLPeerUnverifiedException sslPeerUnverifiedException = new SSLPeerUnverifiedException("The authenticity of host '" + host + "' can't be established: " + e); sslPeerUnverifiedException.initCause(e); throw sslPeerUnverifiedException; } } };
public void verify(String host, SSLSocket ssl) throws IOException { try { internalVerifier.verify(host, ssl); } catch (SSLPeerUnverifiedException e) { SSLPeerUnverifiedException sslPeerUnverifiedException = new SSLPeerUnverifiedException("The authenticity of host '" + host + "' can't be established: " + e); sslPeerUnverifiedException.initCause(e); throw sslPeerUnverifiedException; } } };
/** * Converts the peer certificates into a cert chain. */ static javax.security.cert.X509Certificate[] toCertificateChain(X509Certificate[] certificates) throws SSLPeerUnverifiedException { try { javax.security.cert.X509Certificate[] chain = new javax.security.cert.X509Certificate[certificates.length]; for (int i = 0; i < certificates.length; i++) { byte[] encoded = certificates[i].getEncoded(); chain[i] = javax.security.cert.X509Certificate.getInstance(encoded); } return chain; } catch (CertificateEncodingException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } catch (CertificateException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } }
/** * Provide a value to initialize the volatile peerCertificateChain * field based on the native SSL_SESSION */ private javax.security.cert.X509Certificate[] createPeerCertificateChain() throws SSLPeerUnverifiedException { try { javax.security.cert.X509Certificate[] chain = new javax.security.cert.X509Certificate[peerCertificates.length]; for (int i = 0; i < peerCertificates.length; i++) { byte[] encoded = peerCertificates[i].getEncoded(); chain[i] = javax.security.cert.X509Certificate.getInstance(encoded); } return chain; } catch (CertificateEncodingException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } catch (CertificateException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } }
/** * Converts the peer certificates into a cert chain. */ static javax.security.cert.X509Certificate[] toCertificateChain(X509Certificate[] certificates) throws SSLPeerUnverifiedException { try { javax.security.cert.X509Certificate[] chain = new javax.security.cert.X509Certificate[certificates.length]; for (int i = 0; i < certificates.length; i++) { byte[] encoded = certificates[i].getEncoded(); chain[i] = javax.security.cert.X509Certificate.getInstance(encoded); } return chain; } catch (CertificateEncodingException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } catch (CertificateException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } }
/** * Provide a value to initialize the volatile peerCertificateChain * field based on the native SSL_SESSION */ private javax.security.cert.X509Certificate[] createPeerCertificateChain() throws SSLPeerUnverifiedException { try { javax.security.cert.X509Certificate[] chain = new javax.security.cert.X509Certificate[peerCertificates.length]; for (int i = 0; i < peerCertificates.length; i++) { byte[] encoded = peerCertificates[i].getEncoded(); chain[i] = javax.security.cert.X509Certificate.getInstance(encoded); } return chain; } catch (CertificateEncodingException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } catch (CertificateException e) { SSLPeerUnverifiedException exception = new SSLPeerUnverifiedException(e.getMessage()); exception.initCause(exception); throw exception; } }
} else if (e instanceof SSLPeerUnverifiedException) { throw (SSLPeerUnverifiedException) new SSLPeerUnverifiedException(msg).initCause(e); } else if (e instanceof SSLProtocolException) { throw (SSLProtocolException)
pue.initCause(failInHandshake); throw pue;
} else if (e instanceof SSLPeerUnverifiedException) { throw (SSLPeerUnverifiedException) new SSLPeerUnverifiedException(msg).initCause(e); } else if (e instanceof SSLProtocolException) { throw (SSLProtocolException)