You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/02/15 18:14:28 UTC

svn commit: r910266 - in /tomcat/trunk: java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java webapps/docs/config/http.xml

Author: markt
Date: Mon Feb 15 17:14:27 2010
New Revision: 910266

URL: http://svn.apache.org/viewvc?rev=910266&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48545
Truststores don't have to have passwords
Based on a patch by 'smmwpf54'

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
    tomcat/trunk/webapps/docs/config/http.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=910266&r1=910265&r2=910266&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java Mon Feb 15 17:14:27 2010
@@ -310,9 +310,6 @@
             truststorePassword =
                 System.getProperty("javax.net.ssl.trustStorePassword");
         }
-        if( truststorePassword == null ) {
-            truststorePassword = getKeystorePassword();
-        }
         if(log.isDebugEnabled()) {
             log.debug("TrustPass = " + truststorePassword);
         }
@@ -343,7 +340,7 @@
             log.debug("trustProvider = " + truststoreProvider);
         }
 
-        if (truststoreFile != null && truststorePassword != null){
+        if (truststoreFile != null){
             trustStore = getStore(truststoreType, truststoreProvider,
                     truststoreFile, truststorePassword);
         }
@@ -374,8 +371,12 @@
                 }
                 istream = new FileInputStream(keyStoreFile);
             }
-
-            ks.load(istream, pass.toCharArray());
+            
+            char[] storePass = null;
+            if (pass != null) {
+                storePass = pass.toCharArray(); 
+            }
+            ks.load(istream, storePass);
         } catch (FileNotFoundException fnfe) {
             log.error(sm.getString("jsse.keystore_load_failed", type, path,
                     fnfe.getMessage()), fnfe);

Modified: tomcat/trunk/webapps/docs/config/http.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=910266&r1=910265&r2=910266&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Mon Feb 15 17:14:27 2010
@@ -921,9 +921,7 @@
     <attribute name="truststorePass" required="false">
       <p>The password to access the trust store. The default is the value of the
       <code>javax.net.ssl.trustStorePassword</code> system property. If that
-      property is null, the value of <code>keystorePass</code> is used as the
-      default. If neither this attribute, the default system property nor
-      <code>keystorePass</code>is set, no trust store will be configured.</p>
+      property is null, no trust store password will be configured.</p>
     </attribute>
 
     <attribute name="truststoreProvider" required="false">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org