tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse JSSE13SocketFactory.java
Date Tue, 14 Dec 2004 07:02:32 GMT
billbarker    2004/12/13 23:02:32

  Modified:    util/java/org/apache/tomcat/util/net/jsse
                        JSSE13SocketFactory.java
  Log:
  JSSE 1.0.x doesn't include sun.security.provider.Sun, so we can't assume that it will be
available.
  
  Fix for Bug #32680
  
  Revision  Changes    Path
  1.10      +7 -1      jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE13SocketFactory.java
  
  Index: JSSE13SocketFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE13SocketFactory.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JSSE13SocketFactory.java	2 Jul 2004 03:27:39 -0000	1.9
  +++ JSSE13SocketFactory.java	14 Dec 2004 07:02:32 -0000	1.10
  @@ -20,6 +20,7 @@
   import java.security.KeyStore;
   import java.security.SecureRandom;
   import java.security.Security;
  +import java.security.Provider;
   
   import javax.net.ssl.SSLServerSocket;
   import javax.net.ssl.SSLSocket;
  @@ -66,7 +67,12 @@
        */
        void init() throws IOException {
           try {
  -            Security.addProvider (new sun.security.provider.Sun());
  +            try {
  +                Class ssps = Class.forName("sun.security.provider.Sun");
  +                Security.addProvider ((Provider)ssps.newInstance());
  +            }catch(Exception cnfe) {
  +                //Ignore, since this is a non-Sun JVM
  +            }
               Security.addProvider (new com.sun.net.ssl.internal.ssl.Provider());
   
               String clientAuthStr = (String)attributes.get("clientauth");
  
  
  

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


Mime
View raw message