From: billbarker Date: Mon, 24 Apr 2006 00:37:32 +0000 (+0000) Subject: Clean up the default algorithm handling, now that JSSE 1.0 is no longer supported. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=998f441eef318de63a69efa01016525ce6b3f528;p=tomcat7.0 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 :). git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@396357 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java b/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java index 0d317df11..e99733931 100644 --- a/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java +++ b/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java @@ -82,7 +82,6 @@ public class JSSESocketFactory // 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 @@ public class JSSESocketFactory // 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 @@ public class JSSESocketFactory 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 @@ public class JSSESocketFactory */ 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;