Package javax.rmi.ssl

Examples of javax.rmi.ssl.SslRMIServerSocketFactory


                    throw new IllegalStateException(sm.getString(
                            "jmxRemoteLifecycleListener.sslRmiBindAddress"));
                }

                csf = new SslRMIClientSocketFactory();
                ssf = new SslRMIServerSocketFactory(ciphers, protocols,
                            clientAuth);
            }

            // Force server bind address if required
            if (rmiBindAddress != null) {
View Full Code Here


      if (rmiRegistryPort == rmiConnectorPort) {
        throw new IOException("SSL is enabled. " +
            "rmiConnectorPort cannot share with the rmiRegistryPort!");
      }
      csf = new SslRMIClientSocketFactory();
      ssf = new SslRMIServerSocketFactory();
    }

    if (csf != null) {
      jmxEnv.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
    }
View Full Code Here

                }
            }

            //create the SSL RMI socket factories
            csf = new SslRMIClientSocketFactory();
            ssf = new SslRMIServerSocketFactory();

            _log.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" +
                     (port +PORT_EXPORT_OFFSET) + ") with SSL");
            _startupLog.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" +
                     (port +PORT_EXPORT_OFFSET) + ") with SSL");
View Full Code Here

import junit.framework.TestCase;

public class SslRMIServerSocketFactoryTest extends TestCase {

    public void testSslRMIServerSocketFactory() {
        SslRMIServerSocketFactory factory = new SslRMIServerSocketFactory();
        SslRMIServerSocketFactory factory1 = new SslRMIServerSocketFactory(
                null, null, false);
        assertTrue(factory.equals(factory1));
        assertTrue(factory1.equals(factory));
        assertNull(factory.getEnabledCipherSuites());
        assertNull(factory.getEnabledProtocols());
        assertFalse(factory.getNeedClientAuth());

        factory1 = new SslRMIServerSocketFactory(null, null, true);
        assertTrue(factory1.getNeedClientAuth());
        assertFalse(factory.equals(factory1));
        assertFalse(factory1.equals(factory));

        factory1 = new SslRMIServerSocketFactory(null,
                new String[] { "TLSv1" }, false);
        assertFalse(factory.equals(factory1));
        assertFalse(factory1.equals(factory));
       
        SSLServerSocketFactory tmpfac = (SSLServerSocketFactory) SSLServerSocketFactory
                .getDefault();       
        factory1 = new SslRMIServerSocketFactory(tmpfac.getDefaultCipherSuites(),
                null, false);
        assertFalse(factory.equals(factory1));
        assertFalse(factory1.equals(factory));

        try {
            new SslRMIServerSocketFactory(new String[] { "Incorrect" }, null,
                    false);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }

        try {
            new SslRMIServerSocketFactory(null, new String[] { "Incorrect" },
                    false);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
View Full Code Here

        }

    }
   
    public void testCreateServerSocket() throws Exception {
        SslRMIServerSocketFactory factory = new SslRMIServerSocketFactory();

        factory.createServerSocket(0).close();
       
        try {
            factory.createServerSocket(-1);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
    }
View Full Code Here

    }

    public void testCreateSocket() throws Exception {

        SslRMIClientSocketFactory factoryCln = new SslRMIClientSocketFactory();
        SslRMIServerSocketFactory factorySrv = new SslRMIServerSocketFactory();

        ServerSocket ssocket = factorySrv.createServerSocket(0);
        SSLSocket csocket = (SSLSocket) factoryCln.createSocket("localhost",
                ssocket.getLocalPort());
        csocket.close();
        ssocket.close();

        String old = System
                .getProperty("javax.rmi.ssl.client.enabledCipherSuites");
        try {
            System.setProperty("javax.rmi.ssl.client.enabledCipherSuites",
                    "Incorrect");
            ssocket = factorySrv.createServerSocket(0);
            try {
                factoryCln.createSocket("localhost", ssocket.getLocalPort());
                fail("No expected IOException");
            } catch (IOException e) {
            }
View Full Code Here

            RMIServerSocketFactory ssf = null;

            // Configure SSL for RMI connection if required
            if (rmiSSL) {
                csf = new SslRMIClientSocketFactory();
                ssf = new SslRMIServerSocketFactory(ciphers, protocols,
                            clientAuth);
            }
           
            // Force the use of local ports if required
            if (useLocalPorts) {
View Full Code Here

        final String enableSSL = System.getProperty(JMX_SSL_PROPERTY);
        if (Boolean.getBoolean(enableSSL)) {
            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            jmxEnv.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
           
            SslRMIServerSocketFactory ssf = new SslRMIServerSocketFactory();
            jmxEnv.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
        }

        //Password file options
        final String passwordFile = System.getProperty(JMX_PASSWORD_FILE_PROPERTY);
View Full Code Here

                }
            }

            //create the SSL RMI socket factories
            csf = new SslRMIClientSocketFactory();
            ssf = new SslRMIServerSocketFactory();
        }
        else
        {
            //Do not specify any specific RMI socket factories, resulting in use of the defaults.
            csf = null;
View Full Code Here

          // Environment map
          log.debug("Initialize the environment map");
          env = new HashMap();
          // Provide SSL-based RMI socket factories
          SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
          SslRMIServerSocketFactory ssf = new SslRMIServerSocketFactory();
          env
              .put(
                  RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE,
                  csf);
          env
View Full Code Here

TOP

Related Classes of javax.rmi.ssl.SslRMIServerSocketFactory

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.