Examples of CustomSSLSocketFactory


Examples of org.jboss.remoting.security.CustomSSLSocketFactory

         client = new Client(locator, config);
         client.connect();
        
         // Test that parameters are properly set.
         RemoteClientInvoker clientInvoker = (RemoteClientInvoker) client.getInvoker();
         CustomSSLSocketFactory socketFactory = (CustomSSLSocketFactory) clientInvoker.getSocketFactory();
         assertTrue(socketFactory.getSSLSocketBuilder().getTrustStoreType().equals("JKS"));
         //         assertTrue(socketFactory.gett.equals("JKS"));
      }
      catch (Throwable t)
      {
         log.error(t);
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

      // authentication.
      if (hostnameVerifier == null)
      {
         if (getSocketFactory() instanceof CustomSSLSocketFactory)
         {
            CustomSSLSocketFactory sf = (CustomSSLSocketFactory) getSocketFactory();
            SSLSocketBuilderMBean builder = sf.getSSLSocketBuilder();
            if (( builder.isSocketUseClientMode() && !builder.isServerAuthMode())
             || (!builder.isSocketUseClientMode() &&  builder.isClientAuthModeNone()))
               hostnameVerifier = new AnyhostVerifier();
         }
      }
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

         client = new Client(locator, config);
         client.connect();
        
         // Test that parameters are properly set.
         RemoteClientInvoker clientInvoker = (RemoteClientInvoker) client.getInvoker();
         CustomSSLSocketFactory socketFactory = (CustomSSLSocketFactory) clientInvoker.getSocketFactory();
         assertTrue(socketFactory.getSSLSocketBuilder().getTrustStoreType().equals("JKS"));
         //         assertTrue(socketFactory.gett.equals("JKS"));
      }
      catch (Throwable t)
      {
         log.error(t);
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

         // Verify SocketFactory was configured according to SSL parameters
         // in config map.
         ClientInvoker clientInvoker = client.getInvoker();
         SocketFactory sf = clientInvoker.getSocketFactory();
         assertTrue(sf instanceof CustomSSLSocketFactory);
         CustomSSLSocketFactory cssf = (CustomSSLSocketFactory) sf;
         builder = cssf.getSSLSocketBuilder();
         assertTrue(builder.isSocketUseClientMode());
         assertEquals("JKS", builder.getKeyStoreType());
         file1 = new File(trustStoreFilePath);
         file2 = new File(builder.getTrustStore().getFile());
         assertEquals(file1, file2);

         //////////////////////////////////////////////
         /////     Do server side callback test.   ////
         //////////////////////////////////////////////
         Thread.sleep(500);
         freeport = PortUtil.findFreePort(getHostName());
         InvokerLocator callbackLocator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
         HashMap config = new HashMap();
         addExtraCallbackConfig(config);
         Connector callbackConnector = new Connector(callbackLocator.getLocatorURI(), config);
         ServerSocketFactory ssf3 = getDefaultCallbackServerSocketFactory();
         callbackConnector.setServerSocketFactory(ssf3);
         callbackConnector.create();
         callbackConnector.addInvocationHandler("sample", new SampleInvocationHandler());
         callbackConnector.start();

         CallbackHandler callbackHandler = new CallbackHandler();
         String callbackHandleObject = "myCallbackHandleObject";
         client.addListener(callbackHandler, callbackLocator, callbackHandleObject);

         // Verify that callback succeeded.
         assertEquals(1, callbackHandler.getCallbacks().size());

         // Verify SocketFactory was configured according to SSL parameters in config map.
         Field field = ServerInvoker.class.getDeclaredField("handlers");
         field.setAccessible(true);
         Map handlers = (Map) field.get(serverInvoker);
         Object obj = handlers.values().iterator().next();
         SampleInvocationHandler sampleInvocationHandler = (SampleInvocationHandler) obj;
         obj = sampleInvocationHandler.getCallbackHandler();
         ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) obj;
         field = ServerInvokerCallbackHandler.class.getDeclaredField("callBackClient");
         field.setAccessible(true);
         Client callbackClient = (Client) field.get(serverInvokerCallbackHandler);
         ClientInvoker callbackClientInvoker = callbackClient.getInvoker();
         sf = callbackClientInvoker.getSocketFactory();
         assertTrue(sf instanceof CustomSSLSocketFactory);
         cssf = (CustomSSLSocketFactory) sf;
         builder = cssf.getSSLSocketBuilder();
         assertFalse(builder.isSocketUseClientMode());
         assertEquals("JKS", builder.getKeyStoreType());
         file1 = new File(keyStoreFilePath);
         file2 = new File(builder.getKeyStore().getFile());
         assertEquals(file1, file2);
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

      // authentication.
      if (hostnameVerifier == null)
      {
         if (getSocketFactory() instanceof CustomSSLSocketFactory)
         {
            CustomSSLSocketFactory sf = (CustomSSLSocketFactory) getSocketFactory();
            SSLSocketBuilderMBean builder = sf.getSSLSocketBuilder();
            if (( builder.isSocketUseClientMode() && !builder.isServerAuthMode())
             || (!builder.isSocketUseClientMode() &&  builder.isClientAuthModeNone()))
               hostnameVerifier = new AnyhostVerifier();
         }
      }
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

      // authentication.
      if (hostnameVerifier == null)
      {
         if (getSocketFactory() instanceof CustomSSLSocketFactory)
         {
            CustomSSLSocketFactory sf = (CustomSSLSocketFactory) getSocketFactory();
            SSLSocketBuilderMBean builder = sf.getSSLSocketBuilder();
            if (( builder.isSocketUseClientMode() && !builder.isServerAuthMode())
             || (!builder.isSocketUseClientMode() &&  builder.isClientAuthModeNone()))
               hostnameVerifier = new AnyhostVerifier();
         }
      }
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

/*     */
/* 205 */     if (hostnameVerifier == null)
/*     */     {
/* 207 */       if ((getSocketFactory() instanceof CustomSSLSocketFactory))
/*     */       {
/* 209 */         CustomSSLSocketFactory sf = (CustomSSLSocketFactory)getSocketFactory();
/* 210 */         SSLSocketBuilderMBean builder = sf.getSSLSocketBuilder();
/* 211 */         if (((builder.isSocketUseClientMode()) && (!builder.isServerAuthMode())) || ((!builder.isSocketUseClientMode()) && (builder.isClientAuthModeNone())))
/*     */         {
/* 213 */           hostnameVerifier = new AnyhostVerifier();
/*     */         }
/*     */       }
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

      // authentication.
      if (hostnameVerifier == null)
      {
         if (getSocketFactory() instanceof CustomSSLSocketFactory)
         {
            CustomSSLSocketFactory sf = (CustomSSLSocketFactory) getSocketFactory();
            SSLSocketBuilderMBean builder = sf.getSSLSocketBuilder();
            if (( builder.isSocketUseClientMode() && !builder.isServerAuthMode())
             || (!builder.isSocketUseClientMode() &&  builder.isClientAuthModeNone()))
               hostnameVerifier = new AnyhostVerifier();
         }
      }
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

         // Verify SocketFactory was configured according to SSL parameters
         // in config map.
         ClientInvoker clientInvoker = client.getInvoker();
         SocketFactory sf = clientInvoker.getSocketFactory();
         assertTrue(sf instanceof CustomSSLSocketFactory);
         CustomSSLSocketFactory cssf = (CustomSSLSocketFactory) sf;
         builder = cssf.getSSLSocketBuilder();
         assertTrue(builder.isSocketUseClientMode());
         assertEquals("JKS", builder.getKeyStoreType());
         file1 = new File(trustStoreFilePath);
         file2 = new File(builder.getTrustStore().getFile());
         assertEquals(file1, file2);

         //////////////////////////////////////////////
         /////     Do server side callback test.   ////
         //////////////////////////////////////////////
         Thread.sleep(500);
         freeport = PortUtil.findFreePort(getHostName());
         InvokerLocator callbackLocator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
         HashMap config = new HashMap();
         addExtraCallbackConfig(config);
         Connector callbackConnector = new Connector(callbackLocator.getLocatorURI(), config);
         ServerSocketFactory ssf3 = getDefaultCallbackServerSocketFactory();
         callbackConnector.setServerSocketFactory(ssf3);
         callbackConnector.create();
         callbackConnector.addInvocationHandler("sample", new SampleInvocationHandler());
         callbackConnector.start();

         CallbackHandler callbackHandler = new CallbackHandler();
         String callbackHandleObject = "myCallbackHandleObject";
         client.addListener(callbackHandler, callbackLocator, callbackHandleObject);

         // Verify that callback succeeded.
         assertEquals(1, callbackHandler.getCallbacks().size());

         // Verify SocketFactory was configured according to SSL parameters in config map.
         Field field = ServerInvoker.class.getDeclaredField("handlers");
         field.setAccessible(true);
         Map handlers = (Map) field.get(serverInvoker);
         Object obj = handlers.values().iterator().next();
         SampleInvocationHandler sampleInvocationHandler = (SampleInvocationHandler) obj;
         obj = sampleInvocationHandler.getCallbackHandler();
         ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) obj;
         field = ServerInvokerCallbackHandler.class.getDeclaredField("callBackClient");
         field.setAccessible(true);
         Client callbackClient = (Client) field.get(serverInvokerCallbackHandler);
         ClientInvoker callbackClientInvoker = callbackClient.getInvoker();
         sf = callbackClientInvoker.getSocketFactory();
         assertTrue(sf instanceof CustomSSLSocketFactory);
         cssf = (CustomSSLSocketFactory) sf;
         builder = cssf.getSSLSocketBuilder();
         assertFalse(builder.isSocketUseClientMode());
         assertEquals("JKS", builder.getKeyStoreType());
         file1 = new File(keyStoreFilePath);
         file2 = new File(builder.getKeyStore().getFile());
         assertEquals(file1, file2);
View Full Code Here

Examples of org.jboss.remoting.security.CustomSSLSocketFactory

         client = new Client(locator, config);
         client.connect();
        
         // Test that parameters are properly set.
         RemoteClientInvoker clientInvoker = (RemoteClientInvoker) client.getInvoker();
         CustomSSLSocketFactory socketFactory = (CustomSSLSocketFactory) clientInvoker.getSocketFactory();
         assertTrue(socketFactory.getSSLSocketBuilder().getTrustStoreType().equals("JKS"));
         //         assertTrue(socketFactory.gett.equals("JKS"));
      }
      catch (Throwable t)
      {
         log.error(t);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.