Package javax.net

Examples of javax.net.ServerSocketFactory


    return ctx.getServerSocketFactory();
  }

  protected ServerSocket createServerSocket(int port, int backlog, String address) throws Exception {
    ServerSocketFactory serverSocketFactory = createServerSocketFactory();

    SSLServerSocket serverSocket = null;
    if (address.equals("0.0.0.0")) {
      serverSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port, backlog);
    } else {
      serverSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port, backlog, InetAddress.getByName(address));
    }

    // require mutual authentication
    serverSocket.setNeedClientAuth(true);
    // request mutual authentication
View Full Code Here


   /** Test the JSSE installation
    */
   public void testJSSE() throws Exception
   {
      log.debug("+++ testJSSE");
      ServerSocketFactory factory =
         SSLServerSocketFactory.getDefault();
      SSLServerSocket sslSocket = (SSLServerSocket)
         factory.createServerSocket(0);
      int port = sslSocket.getLocalPort();

      String [] cipherSuites = sslSocket.getEnabledCipherSuites();
      for(int i = 0; i < cipherSuites.length; i++)
      {
View Full Code Here

      {
         log.error("Failed to init SSLContext", e);
         throw new IOException("Failed to get SSLContext for TLS algorithm");
      }

      ServerSocketFactory factory = sslCtx.getServerSocketFactory();
      ServerSocket serverSocket = factory.createServerSocket(0);
      getLog().debug("Created serverSocket: "+serverSocket);
      int port = serverSocket.getLocalPort();
      InetAddress addr = serverSocket.getInetAddress();
      httpsURL = "https://localhost:" + port + '/';
      AcceptThread thread = new AcceptThread(serverSocket, getLog(), httpsURL);
View Full Code Here

                     
    // Create the right kind of socket
    switch (getSSLMode()) {
    case SSL_OFF:
    default:
      ServerSocketFactory sf =
        ServerSocketFactory.getDefault();
      return sf.createServerSocket(portNumber
                     ,0,
                     hostAddress);
    case SSL_BASIC:
      SSLServerSocketFactory ssf =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
View Full Code Here

                     
    // Create the right kind of socket
    switch (getSSLMode()) {
    case SSL_OFF:
    default:
      ServerSocketFactory sf =
        ServerSocketFactory.getDefault();
      return sf.createServerSocket(portNumber
                     ,0,
                     hostAddress);
    case SSL_BASIC:
      SSLServerSocketFactory ssf =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
View Full Code Here

            next.start();

            ServerSocket serverSocket;
            try {
                if (secure) {
                    ServerSocketFactory factory = SSLServerSocketFactory.getDefault();
                    serverSocket = factory.createServerSocket(port, backlog, address);
                    final String[] enabledCipherSuites = { "SSL_DH_anon_WITH_RC4_128_MD5" };
                    ((SSLServerSocket) serverSocket).setEnabledCipherSuites(enabledCipherSuites);
                } else {
                    serverSocket = new ServerSocket(port, backlog, address);
                }
View Full Code Here

            next.start();

            ServerSocket serverSocket;
            try {
                if (secure) {
                    ServerSocketFactory factory = SSLServerSocketFactory.getDefault();
                    serverSocket = factory.createServerSocket(port, backlog, inetAddress);
                    final String[] enabledCipherSuites = { "SSL_DH_anon_WITH_RC4_128_MD5" };
                    ((SSLServerSocket) serverSocket).setEnabledCipherSuites(enabledCipherSuites);
                } else {
                    serverSocket = new ServerSocket(port, backlog, inetAddress);
                }
View Full Code Here

    try
      {
  if (_server)
    {
      // Get a server socket
      ServerSocketFactory ssf = ServerSocketFactory.getDefault ();
      ServerSocket ss = ssf.createServerSocket (_port, 1);
      _socket = ss.accept ();
    }
  else
    {
      // Get a client socket (the factory will connect it)
View Full Code Here

  
   protected ServerSocketFactory createServerSocketFactory()
   throws NoSuchAlgorithmException, KeyManagementException, IOException,
   CertificateException, UnrecoverableKeyException, KeyStoreException
   {
      ServerSocketFactory serverSocketFactory = null;
     
      SSLSocketBuilder server = new SSLSocketBuilder();
      server.setUseSSLServerSocketFactory(false);
     
      server.setSecureSocketProtocol("SSL");
View Full Code Here

   /**
    * @see org.jboss.remoting.security.SSLSocketBuilderMBean#createSSLServerSocketFactory(org.jboss.remoting.security.CustomSSLServerSocketFactory)
    */
   public ServerSocketFactory createSSLServerSocketFactory(CustomSSLServerSocketFactory wrapper) throws IOException
   {
      ServerSocketFactory ssf = null;

      if( getUseSSLServerSocketFactory() )
      {
         ssf = SSLServerSocketFactory.getDefault();
      }
View Full Code Here

TOP

Related Classes of javax.net.ServerSocketFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.