use of gnu.inet.util.EmptyX509TrustManager in project ats-framework by Axway.
the class InetSmtpConnection method getSSLSocketFactory.
/**
* Returns a configured SSLSocketFactory to use in creating new SSL
* sockets.
* @param tm an optional trust manager to use
*/
protected SSLSocketFactory getSSLSocketFactory(TrustManager tm) throws GeneralSecurityException {
if (tm == null) {
tm = new EmptyX509TrustManager();
}
SSLContext context = SSLContext.getInstance("TLS");
TrustManager[] trust = new TrustManager[] { tm };
context.init(null, trust, null);
return context.getSocketFactory();
}
Aggregations