[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/http/ssl ...

Ron Sigal ron_sigal at yahoo.com
Mon Nov 13 13:09:28 EST 2006


  User: rsigal  
  Date: 06/11/13 13:09:28

  Modified:    src/main/org/jboss/remoting/transport/http/ssl 
                        HTTPSClientInvoker.java
  Log:
  JBREM-525:  Use AnyhostVerifier if authentication is turned off on client side.
  
  Revision  Changes    Path
  1.12      +17 -0     JBossRemoting/src/main/org/jboss/remoting/transport/http/ssl/HTTPSClientInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPSClientInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/http/ssl/HTTPSClientInvoker.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- HTTPSClientInvoker.java	15 Jul 2006 04:40:10 -0000	1.11
  +++ HTTPSClientInvoker.java	13 Nov 2006 18:09:28 -0000	1.12
  @@ -24,7 +24,9 @@
   
   import org.jboss.remoting.Client;
   import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.security.CustomSSLSocketFactory;
   import org.jboss.remoting.security.SSLSocketBuilder;
  +import org.jboss.remoting.security.SSLSocketBuilderMBean;
   import org.jboss.remoting.transport.http.HTTPClientInvoker;
   
   import javax.net.SocketFactory;
  @@ -194,6 +196,21 @@
            }
         }
         
  +      // If we still don't have a HostnameVerifier, see if the SocketFactory is an instance of
  +      // org.jboss.remoting.security.CustomSSLSocketFactory, and, if so, if it has turned off
  +      // 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();
  +         }
  +      }
  +      
         if (hostnameVerifier != null)
            conn.setHostnameVerifier(hostnameVerifier);
      }
  
  
  



More information about the jboss-cvs-commits mailing list