kward       2002/12/20 22:40:38

  Modified:    java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl
                        CollectionImpl.java HostnameVerifierImpl.java
                        X509TrustManagerImpl.java
  Log:
  added comments...
  
  Revision  Changes    Path
  1.2       +9 -7      
xml-xindice/java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl/CollectionImpl.java
  
  Index: CollectionImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl/CollectionImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CollectionImpl.java       21 Dec 2002 06:13:27 -0000      1.1
  +++ CollectionImpl.java       21 Dec 2002 06:40:38 -0000      1.2
  @@ -130,8 +130,9 @@
   
           String xmlrpcURI = "https://"; + hostPort + XINDICE_SERVICE_LOCATION;
   
  +        /* Setup the SSL connection */
           try {
  -            System.out.println("**** XML:DB Driver Info: Initializing SSL 
keys");
  +            //System.out.println("**** XML:DB Driver Info: Initializing SSL 
keys");
               setupSSL();
           } catch (Exception e) {
               throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "SSL client 
failed to initialize", e);
  @@ -699,8 +700,12 @@
           }
        }
   
  +   /**
  +    * Sets up the SSL connection
  +    */
  +
        private static void setupSSL() throws Exception {
  -        //set up system properties
  +
           System.setProperty("java.protocol.handler.pkgs", 
"com.sun.net.ssl.internal.www.protocol");
           System.setProperty("com.sun.net.ssl.dhKeyExchangeFix", "true");
   
  @@ -712,11 +717,8 @@
           SSLContext sc = SSLContext.getInstance( "SSL" );
           sc.init(km,tma,new java.security.SecureRandom());
           SSLSocketFactory sf1 = sc.getSocketFactory();
  +        
           HttpsURLConnection.setDefaultSSLSocketFactory( sf1 );
  -
  -        //Added to allow sites with different names then are on the 
certificate
  -        //completely optional
  -
           HttpsURLConnection.setDefaultHostnameVerifier( new 
HostnameVerifierImpl() );
   
        }
  
  
  
  1.2       +8 -1      
xml-xindice/java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl/HostnameVerifierImpl.java
  
  Index: HostnameVerifierImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl/HostnameVerifierImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HostnameVerifierImpl.java 21 Dec 2002 06:13:27 -0000      1.1
  +++ HostnameVerifierImpl.java 21 Dec 2002 06:40:38 -0000      1.2
  @@ -61,6 +61,13 @@
   
   import java.net.InetAddress;
   
  +/**
  + * Implementation of Sun's <code>HostnameVerifier</code> interface for
  + * loosening up the SSL handshake
  + *
  + * @author <a href="mailto:[EMAIL PROTECTED]">Kurt Ward</a>
  + */
  +
   public class HostnameVerifierImpl implements HostnameVerifier {
   
       public boolean verify(String urlHostname, String certHostname) {
  
  
  
  1.2       +8 -1      
xml-xindice/java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl/X509TrustManagerImpl.java
  
  Index: X509TrustManagerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/client/xmldb/xmlrpcssl/X509TrustManagerImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- X509TrustManagerImpl.java 21 Dec 2002 06:13:27 -0000      1.1
  +++ X509TrustManagerImpl.java 21 Dec 2002 06:40:38 -0000      1.2
  @@ -59,6 +59,13 @@
    */
   import com.sun.net.ssl.X509TrustManager;
   
  +/**
  + * Implementation of Sun's <code>X509TrustManager</code> interface for
  + * non managed keys
  + *
  + * @author <a href="mailto:[EMAIL PROTECTED]">Kurt Ward</a>
  + */
  +
   public class X509TrustManagerImpl implements X509TrustManager {
   
      public boolean isClientTrusted( java.security.cert.X509Certificate[] 
chain ) {
  
  
  

Reply via email to