Author: sebb
Date: Sun Nov 17 14:18:33 2013
New Revision: 1542729
URL: http://svn.apache.org/r1542729
Log:
Detect when keytool application is not available
Modified:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?rev=1542729&r1=1542728&r2=1542729&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Sun Nov 17 14:18:33 2013
@@ -202,7 +202,8 @@ public class ProxyControl extends Generi
public static enum KeystoreMode {
USER_KEYSTORE, // user-provided keystore
JMETER_KEYSTORE, // keystore generated by JMeter; single entry
- DYNAMIC_KEYSTORE
+ DYNAMIC_KEYSTORE, // keystore generated by JMeter; dynamic entries
+ NONE // cannot use keystore
}
static final KeystoreMode KEYSTORE_MODE;
@@ -212,7 +213,9 @@ public class ProxyControl extends Generi
KEYSTORE_MODE = KeystoreMode.USER_KEYSTORE;
log.info("HTTP(S) Test Script Recorder will use the keystore '"+ CERT_PATH_ABS
+ "' with the alias: '" + CERT_ALIAS + "'");
} else {
- if (KeyToolUtils.SUPPORTS_HOST_CERT && USE_DYNAMIC_KEYS) {
+ if (!KeyToolUtils.haveKeytool()) {
+ KEYSTORE_MODE = KeystoreMode.NONE;
+ } else if (KeyToolUtils.SUPPORTS_HOST_CERT && USE_DYNAMIC_KEYS) {
KEYSTORE_MODE = KeystoreMode.DYNAMIC_KEYSTORE;
log.info("HTTP(S) Test Script Recorder SSL Proxy will use keys that support
embedded 3rd party resources in file " + CERT_PATH_ABS);
} else {
@@ -1215,6 +1218,8 @@ public class ProxyControl extends Generi
log.info("HTTP(S) Test Script Recorder will use the keystore '"+ CERT_PATH_ABS
+ "' with the alias: '" + CERT_ALIAS + "'");
initUserKeyStore();
break;
+ case NONE:
+ throw new IOException("Cannot find keytool application and no keystore was provided");
default:
throw new IllegalStateException("Impossible case: " + KEYSTORE_MODE);
}
|