Package javax.net.ssl

Examples of javax.net.ssl.SSLServerSocketFactory


        }
    }

    private void setupSsl() throws GeneralSecurityException {

        SSLServerSocketFactory sssf = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore,keyStoreAvailabilityTimeout);
        RMIServerSocketFactory rssf = new KarafSslRMIServerSocketFactory(sssf, this.isClientAuth());
        RMIClientSocketFactory rcsf = new SslRMIClientSocketFactory();
        environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rssf);
        environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rcsf);
        //@TODO secure RMI connector as well?
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, host, 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

            // Ignore
        }
    }

    private void setupSsl() throws GeneralSecurityException {
        SSLServerSocketFactory sslServerSocketFactory = keystoreManager.createSSLServerFactory(null, secureProtocol, algorithm, keyStore, keyAlias, trustStore, keyStoreAvailabilityTimeout);
        RMIServerSocketFactory rmiServerSocketFactory = new KarafSslRMIServerSocketFactory(sslServerSocketFactory, this.isClientAuth());
        RMIClientSocketFactory rmiClientSocketFactory = new SslRMIClientSocketFactory();
        environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rmiServerSocketFactory);
        environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rmiClientSocketFactory);
        // TODO secure RMI connector as well ?
View Full Code Here

    }
    
    private ServerSocket createServerSocket(final SslConfiguration ssl, final InetAddress address2, final int passivePort) throws IOException, GeneralSecurityException {
        // get server socket factory
        SSLContext ctx = ssl.getSSLContext();
        SSLServerSocketFactory ssocketFactory = ctx.getServerSocketFactory();
       
        // create server socket
        SSLServerSocket sslServerSocket = null;
        if(address2 == null) {
            sslServerSocket = (SSLServerSocket) ssocketFactory.createServerSocket(passivePort, 100);
        } else {
            sslServerSocket = (SSLServerSocket) ssocketFactory.createServerSocket(passivePort, 100, address2);
        }
       
        // initialize server socket
        if(ssl.getClientAuth() == ClientAuth.NEED) {
            sslServerSocket.setNeedClientAuth(true);
View Full Code Here

                handlerContext.setOutputValue("CertNickname",
                    sslProps.get("certNickname"));
            }
        }

        SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
        String[] supportedCiphers = factory.getDefaultCipherSuites();
        Vector ciphers = SipUtil.getCiphersVector(supportedCiphers);

        SelectItem[] commonCiphers = ConfigurationHandlers.getOptions(SipUtil.getCommonCiphers(
                    ciphers));
        SelectItem[] ephemeralCiphers = ConfigurationHandlers.getOptions(SipUtil.getEphemeralCiphers(
View Full Code Here

                sslProps.put("ssl2-enabled", ssl2Prop);
                sslProps.put("ssl3-enabled", ssl3Prop);
                sslProps.put("tls-enabled", tlsProp);

                if (ssl3Prop || tlsProp) {
                    SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
                    String[] supportedCiphers = factory.getDefaultCipherSuites();
                    Vector ciphersVector = SipUtil.getCiphersVector(supportedCiphers);
                    String[] selectedCiphers = SipUtil.getSelectedCiphersList((String) JMXUtil.getAttribute(
                                ssl, "ssl3-tls-ciphers"));
                    String[] selectedCommon = (String[]) handlerContext.getInputValue(
                            "SelectedCommon");
View Full Code Here

            public void run() {
                try {
                    // Creates the server socket
                    SslContextFactory contextFactory = SslUtils
                            .getSslContextFactory(SdcClientHelper.this);
                    SSLServerSocketFactory ssf = contextFactory
                            .createSslContext().getServerSocketFactory();
                    SSLServerSocket serverSocket = (SSLServerSocket) ssf
                            .createServerSocket(getServerPort());

                    // Accept the next socket
                    boolean loop = true;
                    SSLSocket socket = null;
View Full Code Here

            // Below call does not handle TrustManagers, needed when server must
            // authenticate clients.
            context.init(keyFactory.getKeyManagers(), trustFactory == null
                            ? null : trustFactory.getTrustManagers(), null);

            SSLServerSocketFactory ssf = context.getServerSocketFactory();
            SSLServerSocket serverSocket = (SSLServerSocket)ssf.createServerSocket(port, backlog,
                InetAddress.getByName(host));

            return serverSocket;
        }
        catch (IOException x)
View Full Code Here

    KeyManager[]       keyManager = keyManagerFactory.getKeyManagers();

    sslContext.init(keyManager, null, secureRandom);

    SSLSocketFactory     socketFactory = sslContext.getSocketFactory();
    SSLServerSocketFactory   serverSocketFactory = sslContext.getServerSocketFactory();

    return new SocketData(socketFactory, serverSocketFactory);
  }
View Full Code Here


    public ServerSocketFactory getServerSocketFactory(String type) {
     
    if (type.equals("SSL") || type.equals("SSLv3")) {
        SSLServerSocketFactory ssf = null;
        try {
        // set up key manager to do server authentication
        SSLContext ctx;
        KeyManagerFactory kmf;
        KeyStore ks;
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.