Code example for SSLSocketFactory

Methods: createSocket

0
    return ctx;
  } 
 
  private static TSocket createClient(SSLSocketFactory factory, String host, int port, int timeout) throws TTransportException {
    try { 
      SSLSocket socket = (SSLSocket) factory.createSocket(host, port);
      socket.setSoTimeout(timeout);
      return new TSocket(socket);
    } catch (Exception e) {
      throw new TTransportException("Could not connect to " + host + " on port " + port, e);
    } 
  } 
 
 
  /** 
   * A Class to hold all the SSL parameters 
   */ 
  public static class TSSLTransportParameters { 
    protected String protocol = "TLS";
    protected String keyStore;
    protected String keyPass;