billbarker 2003/09/08 21:18:55 Modified: util/java/org/apache/tomcat/util/net/jsse JSSE14SocketFactory.java Log: Add support for specifying the TrustStore algorithm. It defaults to the same as the Keystore algorithm. Revision Changes Path 1.14 +7 -3 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE14SocketFactory.java Index: JSSE14SocketFactory.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE14SocketFactory.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- JSSE14SocketFactory.java 2 Sep 2003 21:34:38 -0000 1.13 +++ JSSE14SocketFactory.java 9 Sep 2003 04:18:55 -0000 1.14 @@ -124,11 +124,15 @@ keystoreType = defaultKeystoreType; } + String trustAlgorithm = (String)attributes.get("truststoreAlgorithme"); + if( trustAlgorithm == null ) { + trustAlgorithm = algorithm; + } // Create and init SSLContext SSLContext context = SSLContext.getInstance(protocol); context.init(getKeyManagers(keystoreType, algorithm, (String) attributes.get("keyAlias")), - getTrustManagers(keystoreType), + getTrustManagers(keystoreType, trustAlgorithm), new SecureRandom()); // create proxy @@ -177,14 +181,14 @@ /** * Gets the intialized trust managers. */ - protected TrustManager[] getTrustManagers(String keystoreType) + protected TrustManager[] getTrustManagers(String keystoreType, String algorithm) throws Exception { TrustManager[] tms = null; KeyStore trustStore = getTrustStore(keystoreType); if (trustStore != null) { - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); + TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(trustStore); tms = tmf.getTrustManagers(); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]