All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.imperva.shcf4j.conn.ssl.InsecureTrustManagerFactorySpi Maven / Gradle / Ivy

Go to download

The Simple HTTP Client Facade for Java (SHCF4J) serves as a simple facade or abstraction for various HTTP client frameworks (e.g. java.net.HttpURLConnection, Apache HttpClient, etc.) allowing the end user to plug in the desired HTTP client framework at deployment time.

The newest version!
package com.imperva.shcf4j.conn.ssl;

import javax.net.ssl.ManagerFactoryParameters;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactorySpi;
import javax.net.ssl.X509ExtendedTrustManager;
import java.security.KeyStore;

/**
 * InsecureTrustManagerFactorySpi
 *
 * @author maxim.kirilov
 */
class InsecureTrustManagerFactorySpi extends TrustManagerFactorySpi {


    private final static X509ExtendedTrustManager TRUST_MANAGER = new TrustAllCertsTrustManager();


    @Override
    protected void engineInit(KeyStore keyStore) {

    }

    @Override
    protected void engineInit(ManagerFactoryParameters managerFactoryParameters) {

    }

    @Override
    protected TrustManager[] engineGetTrustManagers() {
        return new TrustManager[]{TRUST_MANAGER};
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy