org.macrocloud.kernel.toolkit.ssl.DisableValidationTrustManager Maven / Gradle / Ivy
package org.macrocloud.kernel.toolkit.ssl;
import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
* 不进行证书校验.
*
* @author macro
*/
public class DisableValidationTrustManager implements X509TrustManager {
/** The Constant INSTANCE. */
public static final X509TrustManager INSTANCE = new DisableValidationTrustManager();
/**
*
* Title: checkClientTrusted
*
*
* Description:
*
*
* @param x509Certificates
* @param s
* @throws CertificateException
* @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[],
* java.lang.String)
*/
@Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
}
/**
*
* Title: checkServerTrusted
*
*
* Description:
*
*
* @param x509Certificates
* @param s
* @throws CertificateException
* @see javax.net.ssl.X509TrustManager#checkServerTrusted(java.security.cert.X509Certificate[],
* java.lang.String)
*/
@Override
public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
}
/**
*
* Title: getAcceptedIssuers
*
*
* Description:
*
*
* @return
* @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
*/
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}