Package javax.net.ssl

Examples of javax.net.ssl.SSLServerSocketFactory


  private final ApnsServerExceptionDelegate exceptionDelegate;

  public AbstractApnsServerSocket(SSLContext sslContext, int port,
      ExecutorService executorService,
      ApnsServerExceptionDelegate exceptionDelegate) throws IOException {
    SSLServerSocketFactory serverSocketFactory = sslContext
        .getServerSocketFactory();
    serverSocket = (SSLServerSocket) serverSocketFactory
        .createServerSocket(port);
    this.executorService = executorService;
    this.exceptionDelegate = exceptionDelegate;
  }
View Full Code Here


            env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
        } else {
            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
        }
       
        SSLServerSocketFactory sssf = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore, classLoader);
        RMIServerSocketFactory rssf = new GeronimoSslRMIServerSocketFactory(sssf, clientAuth);
        RMIClientSocketFactory rcsf = new SslRMIClientSocketFactory();
        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rssf);
        env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rcsf);
       
View Full Code Here

     */

    /* ------------------------------------------------------------ */
    protected ServerSocket newServerSocket(String host, int port,int backlog) throws IOException
    {
        SSLServerSocketFactory factory = null;
        SSLServerSocket socket = null;

        try
        {
            factory = createFactory();

            socket = (SSLServerSocket) (host==null?
                            factory.createServerSocket(port,backlog):
                            factory.createServerSocket(port,backlog,InetAddress.getByName(host)));

            if (_wantClientAuth)
                socket.setWantClientAuth(_wantClientAuth);
            if (_needClientAuth)
                socket.setNeedClientAuth(_needClientAuth);
View Full Code Here

   * @param ifAddress
   * @return A SSL wrapped TServerSocket
   * @throws TTransportException
   */
  public static TServerSocket getServerSocket(int port, int clientTimeout, boolean clientAuth, InetAddress ifAddress) throws TTransportException {
    SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
    return createServer(factory, port, clientTimeout, clientAuth, ifAddress, null);
  }
View Full Code Here

    }

    @Override
    public ServerSocket createServerSocket(int port, int backlog, InetAddress inetAddress) throws IOException {
        this.initSSLContext();
        SSLServerSocketFactory serverSocketFactory = this.sslContext.getServerSocketFactory();
        SSLServerSocket serverSocket = (SSLServerSocket) serverSocketFactory.createServerSocket(port, backlog, inetAddress);
        if (this.jsseSecurityDomain.getProtocols() != null)
            serverSocket.setEnabledProtocols(this.jsseSecurityDomain.getProtocols());
        if (this.jsseSecurityDomain.getCipherSuites() != null)
            serverSocket.setEnabledCipherSuites(this.jsseSecurityDomain.getCipherSuites());
View Full Code Here

        ServerSocketFactory.getDefault();
      return sf.createServerSocket(portNumber
                     ,0,
                     hostAddress);
    case SSL_BASIC:
      SSLServerSocketFactory ssf =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
      return (SSLServerSocket)ssf.createServerSocket(portNumber,
                               0,
                               hostAddress);
    case SSL_PEER_AUTHENTICATION:
      SSLServerSocketFactory ssf2 =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
      SSLServerSocket sss2=
        (SSLServerSocket)ssf2.createServerSocket(portNumber,
                             0,
                             hostAddress);
      sss2.setNeedClientAuth(true);
      return sss2;
    }
View Full Code Here

            {
                _serverSocket = new ServerSocket();
            }
            else
            {
                SSLServerSocketFactory socketFactory = _sslContext.getServerSocketFactory();
                _serverSocket = socketFactory.createServerSocket();
                ((SSLServerSocket)_serverSocket).setNeedClientAuth(config.needClientAuth());
                ((SSLServerSocket)_serverSocket).setWantClientAuth(config.wantClientAuth());

            }
View Full Code Here

          keystore.load(new FileInputStream(KEYSTORE), KEYSTOREPW);
          KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
          kmf.init(keystore, KEYPAIRPWD);
          SSLContext sslc = SSLContext.getInstance("SSLv3");
          sslc.init(kmf.getKeyManagers(), null, null);
          SSLServerSocketFactory sslServerSocketFactory = sslc.getServerSocketFactory();
         
      /*    SSLServerSocketFactory sslServerSocketFactory =
                       (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();   */
                sslServerSocket =
                        (SSLServerSocket) sslServerSocketFactory.createServerSocket( port, backlog, h);
        }
        catch ( BindException e )
        {
          throw new BindException( "Address already in use: "+h+":"+port );
        }
View Full Code Here

            throw new IllegalStateException
                (this.toString() + " already running");

        ServerSocket ssock;
        if (sslcontext != null) {
            SSLServerSocketFactory sf = sslcontext.getServerSocketFactory();
            ssock = sf.createServerSocket();
        } else {
            ssock = new ServerSocket();
        }
       
        ssock.setReuseAddress(true); // probably pointless for port '0'
View Full Code Here

          keystore.load(new FileInputStream(KEYSTORE), KEYSTOREPW);
          KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
          kmf.init(keystore, KEYPAIRPWD);
          SSLContext sslc = SSLContext.getInstance("SSLv3");
          sslc.init(kmf.getKeyManagers(), null, null);
          SSLServerSocketFactory sslServerSocketFactory = sslc.getServerSocketFactory();
         
      /*    SSLServerSocketFactory sslServerSocketFactory =
                       (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();   */
                sslServerSocket =
                        (SSLServerSocket) sslServerSocketFactory.createServerSocket( port, backlog, h);
        }
        catch ( BindException e )
        {
          throw new BindException( "Address already in use: "+h+":"+port );
        }
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLServerSocketFactory

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.