code: public static SSLSocket getSocket(EncryptionOptions options, InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
      {
          SSLContext ctx = createSSLContext(options, true);
          SSLSocket socket = (SSLSocket) ctx.getSocketFactory().createSocket(address, port, localAddress, localPort);
          String[] suits = filterCipherSuites(socket.getSupportedCipherSuites(), options.cipher_suites);
          socket.setEnabledCipherSuites(suits);
          socket.setEnabledProtocols(ACCEPTED_PROTOCOLS);
          return socket;
      }
docs: Create a socket and connect