private SSLConnectionSocketFactory getSSLSocketFactory() { SSLStarter sslstarter = getLevel().find(SSLStarter.class); if (sslstarter == null) { return null; } else { SSLContext sc = sslstarter.getContext(); return new SSLConnectionSocketFactory(sc); } }
public Socket connect(String host, int port) throws NoSuchAlgorithmException, KeyManagementException, IOException { SocketFactory ss = getLevel().find(SocketFactory.class); Socket s = ss.createSocket(host, port); SSLSocketFactory ssf = getContext().getSocketFactory(); s = ssf.createSocket(s, host, port, true); log(Level.DEBUG, "done SSL handshake for %s", host); return s; }