Package javax.net.ssl

Examples of javax.net.ssl.SSLServerSocketFactory


    }


    public SSLServerSocket newSslServerSocket(String host,int port,int backlog) throws IOException
    {
        SSLServerSocketFactory factory = _context.getServerSocketFactory();

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

        if (getWantClientAuth())
            socket.setWantClientAuth(getWantClientAuth());
        if (getNeedClientAuth())
            socket.setNeedClientAuth(getNeedClientAuth());
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

        return selected_ciphers.toArray(new String[selected_ciphers.size()]);
    }

    public SSLServerSocket newSslServerSocket(String host,int port,int backlog) throws IOException {
        SSLServerSocketFactory factory = sslContext.getServerSocketFactory();

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

        if (sslConfig.getWantClientAuth())
            socket.setWantClientAuth(sslConfig.getWantClientAuth());
        if (sslConfig.getNeedClientAuth())
            socket.setNeedClientAuth(sslConfig.getNeedClientAuth());
View Full Code Here

            {
                _serverSocket = new ServerSocket();
            }
            else
            {
                SSLServerSocketFactory socketFactory = _sslContext.getServerSocketFactory();
                _serverSocket = socketFactory.createServerSocket();

                if(config.needClientAuth())
                {
                    ((SSLServerSocket)_serverSocket).setNeedClientAuth(true);
                }
View Full Code Here

        if (servicedSocket != null) {
            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

            SecurityTool.getKeyStorePassword().toCharArray());
           
        keyManagerFactory.init(keyStore, SecurityTool.getKeyStorePassword().toCharArray());
           
        context.init(keyManagerFactory.getKeyManagers(), null, null);
        SSLServerSocketFactory sslSrvFact = context.getServerSocketFactory();
        return (SSLServerSocket) sslSrvFact.createServerSocket(port);
    }
View Full Code Here

            return this.context.getServerSessionContext();
        }

        @Override
        protected SSLServerSocketFactory engineGetServerSocketFactory() {
            SSLServerSocketFactory factory = this.context.getServerSocketFactory();
            return this.configureSSLServerSocketFactory(factory);
        }
View Full Code Here

         * @param factory the factory to configure
         * @return {@code factory} or a decorated instance there of
         */
        protected SSLServerSocketFactory configureSSLServerSocketFactory(
                SSLServerSocketFactory factory) {
            SSLServerSocketFactory workingFactory = factory;
           
            for (Configurer<SSLServerSocketFactory> configurer : this.sslServerSocketFactoryConfigurers) {
                workingFactory = configurer.configure(workingFactory);
            }
           
View Full Code Here

            {
                _serverSocket = new ServerSocket();
            }
            else
            {
                SSLServerSocketFactory socketFactory = _sslContext.getServerSocketFactory();
                _serverSocket = socketFactory.createServerSocket();

                if(config.needClientAuth())
                {
                    ((SSLServerSocket)_serverSocket).setNeedClientAuth(true);
                }
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

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.