Example usage for java.security.cert CertificateException toString

List of usage examples for java.security.cert CertificateException toString

Introduction

In this page you can find the example usage for java.security.cert CertificateException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.olat.core.util.httpclient.EasyX509TrustManager.java

/**
 * @see javax.net.ssl.X509TrustManager#checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String)
 *//*from w  w  w  .j a  va2s  . c  om*/
@Override
public void checkServerTrusted(X509Certificate[] certificates, String authType) throws CertificateException {
    if ((certificates != null) && LOG.isDebugEnabled()) {
        LOG.debug("Server certificate chain:");
        for (int i = 0; i < certificates.length; i++) {
            LOG.debug("X509Certificate[" + i + "]=" + certificates[i]);
        }
    }
    if (certificates != null) {
        for (int i = 0; i < certificates.length; i++) {
            X509Certificate certificate = certificates[i];
            try {
                certificate.checkValidity();
            } catch (CertificateException e) {
                LOG.error(e.toString());
                throw e;
            }
        }
    } else {
        this.standardTrustManager.checkServerTrusted(certificates, authType);
    }
}