Author: billbarker
Date: Sun Apr 23 17:37:32 2006
New Revision: 396357

URL: http://svn.apache.org/viewcvs?rev=396357&view=rev
Log:
Clean up the default algorithm handling, now that JSSE 1.0 is no longer 
supported.

At least now, you should be able to run SSL on a non-Sun JVM out of the box :).


Modified:
    
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
URL: 
http://svn.apache.org/viewcvs/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=396357&r1=396356&r2=396357&view=diff
==============================================================================
--- 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
 (original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
 Sun Apr 23 17:37:32 2006
@@ -82,7 +82,6 @@
 
     // defaults
     static String defaultProtocol = "TLS";
-    static String defaultAlgorithm = "SunX509";
     static boolean defaultClientAuth = false;
     static String defaultKeystoreType = "JKS";
     private static final String defaultKeystoreFile
@@ -361,7 +360,7 @@
             // Certificate encoding algorithm (e.g., SunX509)
             String algorithm = (String) attributes.get("algorithm");
             if (algorithm == null) {
-                algorithm = defaultAlgorithm;
+                algorithm = KeyManagerFactory.getDefaultAlgorithm();;
             }
 
             String keystoreType = (String) attributes.get("keystoreType");
@@ -371,7 +370,7 @@
 
         String trustAlgorithm = (String)attributes.get("truststoreAlgorithm");
         if( trustAlgorithm == null ) {
-        trustAlgorithm = algorithm;
+            trustAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
         }
             // Create and init SSLContext
             SSLContext context = SSLContext.getInstance(protocol); 
@@ -433,10 +432,6 @@
      */
     protected TrustManager[] getTrustManagers(String keystoreType, String 
algorithm)
         throws Exception {
-        if (attributes.get("truststoreAlgorithm") == null) {
-            // in 1.5, the Trust default isn't the same as the Key default.
-            algorithm = TrustManagerFactory.getDefaultAlgorithm();
-        }
         String crlf = (String) attributes.get("crlFile");
         
         TrustManager[] tms = null;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to