directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nik...@apache.org
Subject svn commit: r449775 - /directory/trunks/mina/integration-spring/src/main/java/org/apache/mina/integration/spring/ssl/SSLContextFactoryBean.java
Date Mon, 25 Sep 2006 18:58:53 GMT
Author: niklas
Date: Mon Sep 25 11:58:51 2006
New Revision: 449775

URL: http://svn.apache.org/viewvc?view=rev&rev=449775
Log:
Applied the patch provided by Wolter Eldering which adds the option of using a ManagerFactoryParameters
object when initializing the TrustManagerFactory (DIRMINA-271).

Modified:
    directory/trunks/mina/integration-spring/src/main/java/org/apache/mina/integration/spring/ssl/SSLContextFactoryBean.java

Modified: directory/trunks/mina/integration-spring/src/main/java/org/apache/mina/integration/spring/ssl/SSLContextFactoryBean.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/integration-spring/src/main/java/org/apache/mina/integration/spring/ssl/SSLContextFactoryBean.java?view=diff&rev=449775&r1=449774&r2=449775
==============================================================================
--- directory/trunks/mina/integration-spring/src/main/java/org/apache/mina/integration/spring/ssl/SSLContextFactoryBean.java
(original)
+++ directory/trunks/mina/integration-spring/src/main/java/org/apache/mina/integration/spring/ssl/SSLContextFactoryBean.java
Mon Sep 25 11:58:51 2006
@@ -27,6 +27,8 @@
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.ManagerFactoryParameters;
+
 
 import org.springframework.beans.factory.config.AbstractFactoryBean;
 import org.springframework.util.Assert;
@@ -73,6 +75,7 @@
     private String trustManagerFactoryAlgorithm = null;
     private String trustManagerFactoryProvider = null;
     private boolean trustManagerFactoryAlgorithmUseDefault = false;
+    private ManagerFactoryParameters trustManagerFactoryParameters = null;
     
     protected Object createInstance() throws Exception
     {
@@ -131,7 +134,14 @@
         TrustManager[] trustManagers = null; 
         if( tmf != null )
         {
-            tmf.init( trustManagerFactoryKeyStore );
+            if( trustManagerFactoryParameters != null )
+            {
+                tmf.init( trustManagerFactoryParameters );
+            }
+            else
+            {
+                tmf.init( trustManagerFactoryKeyStore );
+            }
             trustManagers = tmf.getTrustManagers();
         }
         
@@ -324,12 +334,28 @@
      * Sets the {@link KeyStore} which will be used in the call to 
      * {@link TrustManagerFactory#init(java.security.KeyStore)} when
      * the {@link SSLContext} is created. 
+     * <p>
+     * This property will be ignored if {@link ManagerFactoryParameters} has been
+     * set directly using {@link #setTrustManagerFactoryParameters(ManagerFactoryParameters)}.
+     * </p>
      * 
      * @param keyStore the key store.
      */
     public void setTrustManagerFactoryKeyStore( KeyStore keyStore )
     {
         this.trustManagerFactoryKeyStore = keyStore;
+    }
+
+    /**
+     * Sets the {@link ManagerFactoryParameters} which will be used in the call to
+     * {@link TrustManagerFactory#init(javax.net.ssl.ManagerFactoryParameters)} when
+     * the {@link SSLContext} is created.
+     *  
+     * @param parameters describing provider-specific trust material.
+     */
+    public void setTrustManagerFactoryParameters( ManagerFactoryParameters parameters )
+    {
+        this.trustManagerFactoryParameters = parameters;
     }
 
     /**



Mime
View raw message