[JBoss-dev] CVS update: jbosssx/src/main/org/jboss/security/ssl DomainServerSocketFactory.java RMISSLClientSocketFactory.java RMISSLServerSocketFactory.java

2002-02-08 Thread Scott M Stark

  User: starksm 
  Date: 02/02/08 15:51:45

  Modified:src/main/org/jboss/security/ssl
RMISSLClientSocketFactory.java
RMISSLServerSocketFactory.java
  Added:   src/main/org/jboss/security/ssl
DomainServerSocketFactory.java
  Log:
  Update the socket factories to use a JaasSecurityDomain as the source
  of the KeyStore rather than using hardcoded paths
  
  Revision  ChangesPath
  1.3   +57 -6 
jbosssx/src/main/org/jboss/security/ssl/RMISSLClientSocketFactory.java
  
  Index: RMISSLClientSocketFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/ssl/RMISSLClientSocketFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMISSLClientSocketFactory.java15 Oct 2001 04:32:53 -  1.2
  +++ RMISSLClientSocketFactory.java8 Feb 2002 23:51:45 -   1.3
  @@ -10,14 +10,65 @@
   import java.io.Serializable;
   import java.net.Socket;
   import java.rmi.server.RMIClientSocketFactory;
  +import javax.net.ssl.HandshakeCompletedEvent;
  +import javax.net.ssl.HandshakeCompletedListener;
  +import javax.net.ssl.SSLSession;
   import javax.net.ssl.SSLSocketFactory;
   import javax.net.ssl.SSLSocket;
   
  -public class RMISSLClientSocketFactory implements RMIClientSocketFactory, 
Serializable {
  +import org.jboss.logging.Logger;
   
  -public Socket createSocket(String host, int port) throws IOException {
  -SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
  -SSLSocket socket = (SSLSocket) factory.createSocket(host, port);
  -return socket;
  -}
  +/** An implementation of RMIClientSocketFactory that uses the JSSE
  + default SSLSocketFactory to create a client SSLSocket.
  + *
  + * @author  [EMAIL PROTECTED]
  + * @version $Revision: 1.3 $
  + */
  +public class RMISSLClientSocketFactory implements HandshakeCompletedListener,
  +   RMIClientSocketFactory, Serializable
  +{
  +   private static final long serialVersionUID = -6412485012870705607L;
  +
  +   /** Creates new RMISSLClientSocketFactory */
  +   public RMISSLClientSocketFactory()
  +   {
  +   }
  +
  +   /** Create a client socket connected to the specified host and port.
  +   * @param host - the host name
  +   * @param port - the port number
  +   * @return a socket connected to the specified host and port.
  +   * @exception IOException if an I/O error occurs during socket creation.
  +   */
  +   public java.net.Socket createSocket(String host, int port)
  +  throws IOException
  +   {
  +  SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
  +  SSLSocket socket = (SSLSocket) factory.createSocket(host, port);
  +  socket.addHandshakeCompletedListener(this);
  +  return socket;
  +   }
  +
  +   public boolean equals(Object obj)
  +   {
  +  return obj instanceof RMISSLClientSocketFactory;
  +   }
  +   public int hashCode()
  +   {
  +  return getClass().getName().hashCode();
  +   }
  +
  +   public void handshakeCompleted(HandshakeCompletedEvent handshakeCompletedEvent)
  +   {
  +  Logger log = Logger.getLogger(RMISSLClientSocketFactory.class);
  +  if( log.isTraceEnabled() )
  +  {
  + String cipher = handshakeCompletedEvent.getCipherSuite();
  + SSLSession session = handshakeCompletedEvent.getSession();
  + String peerHost = session.getPeerHost();
  + log.debug(SSL handshakeCompleted, cipher=+cipher
  ++, peerHost=+peerHost);
  +  }
  +   }
  +   
   }
  
  
  
  1.3   +66 -39
jbosssx/src/main/org/jboss/security/ssl/RMISSLServerSocketFactory.java
  
  Index: RMISSLServerSocketFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/ssl/RMISSLServerSocketFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMISSLServerSocketFactory.java15 Oct 2001 04:32:53 -  1.2
  +++ RMISSLServerSocketFactory.java8 Feb 2002 23:51:45 -   1.3
  @@ -6,47 +6,74 @@
*/
   package org.jboss.security.ssl;
   
  -import java.io.FileInputStream;
   import java.io.IOException;
   import java.io.Serializable;
   import java.net.ServerSocket;
  +import java.net.UnknownHostException;
   import java.rmi.server.RMIServerSocketFactory;
  -import javax.net.ssl.SSLServerSocketFactory;
  -import java.security.KeyStore;
  -import java.security.Security;
  -import com.sun.net.ssl.KeyManagerFactory;
  -import com.sun.net.ssl.SSLContext;
  -
  -
  -public class RMISSLServerSocketFactory implements RMIServerSocketFactory, 
Serializable {
  -
  -static {
  -// Security provider for JSSE 1.0.2
  -Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
  -}
  -
  -
  -public 

[JBoss-dev] CVS update: jbosssx/src/main/org/jboss/security/ssl DomainServerSocketFactory.java RMISSLClientSocketFactory.java

2001-11-27 Thread Scott M Stark

  User: starksm 
  Date: 01/11/27 22:10:46

  Modified:src/main/org/jboss/security/ssl Tag: Branch_2_4
DomainServerSocketFactory.java
RMISSLClientSocketFactory.java
  Log:
  Complete switch to org.jboss.logging.Logger
  Add support for package version manifest headers
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.3   +3 -4  
jbosssx/src/main/org/jboss/security/ssl/Attic/DomainServerSocketFactory.java
  
  Index: DomainServerSocketFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/ssl/Attic/DomainServerSocketFactory.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- DomainServerSocketFactory.java2001/11/09 10:18:14 1.1.2.2
  +++ DomainServerSocketFactory.java2001/11/28 06:10:46 1.1.2.3
  @@ -19,8 +19,7 @@
   import com.sun.net.ssl.TrustManager;
   import com.sun.net.ssl.TrustManagerFactory;
   
  -import org.apache.log4j.Category;
  -
  +import org.jboss.logging.Logger;
   import org.jboss.security.SecurityDomain;
   
   /** An implementation of ServerSocketFactory that creates SSL server sockets
  @@ -33,11 +32,11 @@
@see org.jboss.security.SecurityDomain
   
   @author  [EMAIL PROTECTED]
  -@version $Revision: 1.1.2.2 $
  +@version $Revision: 1.1.2.3 $
   */
   public class DomainServerSocketFactory extends ServerSocketFactory
   {
  -   private static Category log = 
Category.getInstance(DomainServerSocketFactory.class);
  +   private static Logger log = Logger.getLogger(DomainServerSocketFactory.class);
  private transient SecurityDomain securityDomain;
  private transient InetAddress bindAddress;
   
  
  
  
  1.2.2.2   +4 -4  
jbosssx/src/main/org/jboss/security/ssl/RMISSLClientSocketFactory.java
  
  Index: RMISSLClientSocketFactory.java
  ===
  RCS file: 
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/ssl/RMISSLClientSocketFactory.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- RMISSLClientSocketFactory.java2001/11/09 10:18:14 1.2.2.1
  +++ RMISSLClientSocketFactory.java2001/11/28 06:10:46 1.2.2.2
  @@ -16,13 +16,13 @@
   import javax.net.ssl.SSLSocketFactory;
   import javax.net.ssl.SSLSocket;
   
  -import org.apache.log4j.Category;
  +import org.jboss.logging.Logger;
   
   /** An implementation of RMIClientSocketFactory that uses the JSSE
default SSLSocketFactory to create a client SSLSocket.
*
* @author  [EMAIL PROTECTED]
  - * @version $Revision: 1.2.2.1 $
  + * @version $Revision: 1.2.2.2 $
*/
   public class RMISSLClientSocketFactory implements HandshakeCompletedListener,
  RMIClientSocketFactory, Serializable
  @@ -60,8 +60,8 @@
   
  public void handshakeCompleted(HandshakeCompletedEvent handshakeCompletedEvent)
  {
  -  Category log = Category.getInstance(RMISSLClientSocketFactory.class);
  -  if( log.isDebugEnabled() )
  +  Logger log = Logger.getLogger(RMISSLClientSocketFactory.class);
  +  if( log.isTraceEnabled() )
 {
String cipher = handshakeCompletedEvent.getCipherSuite();
SSLSession session = handshakeCompletedEvent.getSession();
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development