jsalvata    2002/12/27 05:42:30

  Modified:    src/core/org/apache/jmeter/util SSLManager.java
               src/core/org/apache/jmeter/util/keystore
                        DefaultKeyStore.java
  Log:
  SSLManager should now read client certificates. Changed exception handling to make 
diagnosing similar issues easier.
  
  Revision  Changes    Path
  1.4       +5 -11     jakarta-jmeter/src/core/org/apache/jmeter/util/SSLManager.java
  
  Index: SSLManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/util/SSLManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SSLManager.java   29 Aug 2002 18:17:40 -0000      1.3
  +++ SSLManager.java   27 Dec 2002 13:42:29 -0000      1.4
  @@ -169,15 +169,12 @@
                   File initStore = new File(fileName);
   
                   if (initStore.exists()) {
  -                    try {
  -                        this.keyStore.load(new FileInputStream(initStore), 
password);
  -                    } catch (Exception e) {
  -                        throw new RuntimeException("Can't load KeyStore!!!  " + 
e.getMessage());
  -                    }
  +                 this.keyStore.load(new FileInputStream(initStore),password);
                   } else {
                       this.keyStore.load(null, password);
                   }
               } catch (Exception e) {
  +           throw new RuntimeException("Can't load KeyStore", e);
               }
   
           log.info("JmeterKeyStore Location: " + fileName);
  @@ -215,15 +212,12 @@
                   File initStore = new File(fileName);
   
                   if (initStore.exists()) {
  -                    try {
  -                        this.trustStore.load(new FileInputStream(initStore), null);
  -                    } catch (Exception e) {
  -                        throw new RuntimeException("Can't load KeyStore!!!  " + 
e.getMessage());
  -                    }
  +                 this.trustStore.load(new FileInputStream(initStore), null);
                   } else {
                       this.trustStore.load(null, null);
                   }
               } catch (Exception e) {
  +           throw new RuntimeException("Can't load TrustStore", e);
               }
   
               log.info("TrustStore Location: " + fileName);
  
  
  
  1.2       +3 -3      
jakarta-jmeter/src/core/org/apache/jmeter/util/keystore/DefaultKeyStore.java
  
  Index: DefaultKeyStore.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/util/keystore/DefaultKeyStore.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultKeyStore.java      11 Aug 2002 19:24:50 -0000      1.1
  +++ DefaultKeyStore.java      27 Dec 2002 13:42:30 -0000      1.2
  @@ -90,11 +90,11 @@
   
           Enumeration aliases = store.aliases();
           while (aliases.hasMoreElements()) {
  +         this.alias = (String) aliases.nextElement();
               if (store.isKeyEntry(alias)) {
                   key = (PrivateKey) store.getKey(alias, pword.toCharArray());
                   Certificate[] chain = store.getCertificateChain(alias);
                   certChain = new X509Certificate[chain.length];
  -                this.alias = (String) aliases.nextElement();
   
                   for (int i = 0; i < chain.length; i++) {
                       certChain[i] = (X509Certificate) chain[i];
  @@ -122,4 +122,4 @@
       public final String getAlias() {
           return this.alias;
       }
  -}
  \ No newline at end of file
  +}
  
  
  

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

Reply via email to