Code example for SSLServerSocket

Methods: setSoTimeoutsetEnabledCipherSuitessetNeedClientAuth

  private static TServerSocket createServer(SSLServerSocketFactory factory, int port, int timeout, boolean clientAuth,
                                    InetAddress ifAddress, TSSLTransportParameters params) throws TTransportException {
    try { 
      SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(port, 100, ifAddress);
      if (params != null && params.cipherSuites != null) {
      return new TServerSocket(serverSocket);
    } catch (Exception e) {
      throw new TTransportException("Could not bind to port " + port, e);
   * Get a default SSL wrapped TSocket connected to the specified host and port. All 
   * the client methods return a bound connection. So there is no need to call open() on the  
   * TTransport.