avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/sockets TLSServerSocketFactory.java
Date Sun, 06 Jan 2002 10:27:06 GMT
hammant     02/01/06 02:27:06

  Modified:    src/java/org/apache/avalon/cornerstone/blocks/sockets
                        TLSServerSocketFactory.java
  Log:
  trust manager now configurable thanks to Marcos Sanz
  
  Revision  Changes    Path
  1.6       +7 -4      jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/sockets/TLSServerSocketFactory.java
  
  Index: TLSServerSocketFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/sockets/TLSServerSocketFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TLSServerSocketFactory.java	11 Dec 2001 10:49:20 -0000	1.5
  +++ TLSServerSocketFactory.java	6 Jan 2002 10:27:06 -0000	1.6
  @@ -7,6 +7,7 @@
    */
   package org.apache.avalon.cornerstone.blocks.sockets;
   
  +import com.sun.net.ssl.TrustManagerFactory;
   import com.sun.net.ssl.KeyManagerFactory;
   import com.sun.net.ssl.SSLContext;
   import java.io.File;
  @@ -30,7 +31,7 @@
   import org.apache.avalon.phoenix.BlockContext;
   
   /**
  - * Factory implementation for vanilla TCP sockets.
  + * Factory implementation for TLS TCP sockets.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
  @@ -118,10 +119,9 @@
       protected void initSSLFactory( final KeyStore keyStore )
           throws Exception
       {
  -        /*
  +        
             java.security.Security.addProvider( new sun.security.provider.Sun() );
             java.security.Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider()
);
  -          // */
   
           // set up key manager to do server authentication
           final SSLContext sslContext = SSLContext.getInstance( m_keyStoreProtocol );
  @@ -130,8 +130,11 @@
   
           keyManagerFactory.init( keyStore, m_keyStorePassword.toCharArray() );
   
  +        final TrustManagerFactory tmf = TrustManagerFactory.getInstance(m_keyStoreAlgorithm);
  +        tmf.init(keyStore);
  +
           sslContext.init( keyManagerFactory.getKeyManagers(),
  -                         null,
  +                         tmf.getTrustManagers(),
                            new java.security.SecureRandom() );
   
           // Create socket factory
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message