jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1517999 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
Date Tue, 27 Aug 2013 21:20:01 GMT
Author: sebb
Date: Tue Aug 27 21:20:01 2013
New Revision: 1517999

URL: http://svn.apache.org/r1517999
Log:
Don't save the passwords as static fields

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java?rev=1517999&r1=1517998&r2=1517999&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java Tue Aug
27 21:20:01 2013
@@ -103,11 +103,7 @@ public class Proxy extends Thread {
     private static final String CERT_FILE =
         JMeterUtils.getPropDefault("proxy.cert.file", CERT_FILE_DEFAULT); // $NON-NLS-1$
 
-    private static final char[] KEYSTORE_PASSWORD =
-        JMeterUtils.getPropDefault("proxy.cert.keystorepass", "password").toCharArray();
// $NON-NLS-1$ $NON-NLS-2$
-
-    private static final char[] KEY_PASSWORD =
-        JMeterUtils.getPropDefault("proxy.cert.keypassword","password").toCharArray(); //
$NON-NLS-1$ $NON-NLS-2$
+    private static final String DEFAULT_PASSWORD = "password"; // $NON-NLS-1$
 
     private static final SamplerCreatorFactory factory = new SamplerCreatorFactory();
 
@@ -293,9 +289,9 @@ public class Proxy extends Thread {
                 SSLContext sslcontext = null;
                 try {
                     ks = KeyStore.getInstance(KEYSTORE_TYPE);
-                    ks.load(in, KEYSTORE_PASSWORD);
+                    ks.load(in, JMeterUtils.getPropDefault("proxy.cert.keystorepass", DEFAULT_PASSWORD).toCharArray());
// $NON-NLS-1$
                     kmf = KeyManagerFactory.getInstance(KEYMANAGERFACTORY);
-                    kmf.init(ks, KEY_PASSWORD);
+                    kmf.init(ks, JMeterUtils.getPropDefault("proxy.cert.keypassword", DEFAULT_PASSWORD).toCharArray());
// $NON-NLS-1$
                     sslcontext = SSLContext.getInstance(SSLCONTEXT_PROTOCOL);
                     sslcontext.init(kmf.getKeyManagers(), null, null);
                     SSLSocketFactory sslFactory = sslcontext.getSocketFactory();



Mime
View raw message