com.fireflysource.net.tcp.secure.conscrypt.NoCheckConscryptSSLContextFactory Maven / Gradle / Ivy
package com.fireflysource.net.tcp.secure.conscrypt;
import com.fireflysource.net.tcp.secure.utils.SecureUtils;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
/**
* @author Pengtao Qiu
*/
public class NoCheckConscryptSSLContextFactory extends AbstractConscryptSecureEngineFactory {
private SSLContext sslContext;
public NoCheckConscryptSSLContextFactory() {
try {
sslContext = getSSLContextWithManager(null, new TrustManager[]{SecureUtils.createX509TrustManagerNoCheck()}, null);
} catch (Throwable e) {
LOG.error(e, () -> "get SSL context error");
}
}
@Override
public SSLContext getSSLContext() {
return sslContext;
}
}