When I attempt to start a proxy server in JMeter I'm presented with the following error:
could not create script recording proxy -see log for details: Command:'keytool -genkeypair alias :root_ca: -dname "CN=_DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: root, C=IE" -keyalg RSA -keystore proxyserver.jks -storepass {redacted -keypass {redacted) -validity 7 -ext bc:c' failed, code: 1
illegal option: -ext
Try keytool -help
My proxy configuration:
Any suggestions?
You can fix this by adding the 'Path to JDK' in your start up script (jmeter.bat) -
before invoking java.exe
if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe
Try this for .bat file
Set JAVA_HOME= /path/to/JDK
Set PATH = %PATH%;%JAVA_HOME%/bin
if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe
For .sh file,
export JAVA_HOME=/path/to/JDK
export PATH=$PATH:$JAVA_HOME/bin
java $JVM_ARGS -Dapple.laf.useScreenMenuBar=true -jar `dirname $0`/ApacheJMeter.jar "$#"
Related
I have a jks file and when i run the command keytool -keystore db-ssl-truststore.jks -list , i get the error
keytool error: java.io.IOException: BCFKS KeyStore corrupted: MAC calculation failed.
It seems, that you created keystore in BCFS format using the Bouncy Castle library.
If you want to see it in human-readable format, you can specify -storetype, -provider and -providerpath options for keytool:
keytool -keystore keystore.bckfs -storetype BCFKS -providerpath "bc-fips-1.0.2.jar" -provider org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider -list -v
This question has been asked several times but none of the solutions work for me. I running the DOS command window as Administrator, but when running the keytool command to install a certificate I get the error above:
C:\Program Files\Java\jdk1.8.0_191\jre\lib\security>keytool -import -file xxx.yyy.zzz.crt -alias xxxx.yyy.zzz.com -keystore cacerts -storepass changeit -noprompt
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: cacerts (Access is denied)
I'm on Windows 10 with JDK 1.8.0_191. Why would access be denied to the Administator?
I have faced the same issue.
Here is the solution what I found:
Copy the cacert file other than Java folder [May be D drive or desktop].
Update the path of cacert file path in your command [Sated in question].
Run your query. [You wont get the io exception].
Then replace the new cacert file in the original location.
"Run as administrator Command prompt" has fixed this issue at Windows.
My problem was that I did not have true admin rights to my Windows 10 laptop. I had enough permissions to install the JDK to the default location (which requires admin rights), but not enough rights to use keytool.
I uninstalled the JDK from the default location and reinstalled it in a directory that was not restricted to admin users. Then keytool worked properly.
I get following error when trying to starrt
OS - Mac OS X 10.9.4
Java Version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
For setting Java home
export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile
When echo $JAVA_HOME
$(/usr/libexec/java_home)
When tried
$ java keytool
Exception in thread "main" java.lang.NoClassDefFoundError: keytool
Caused by: java.lang.ClassNotFoundException: keytool
I added Java home in path
echo $PATH
-bash: $(/usr/libexec/java_home)/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin: No such file or directory
014/10/27 16:11:21 ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Command :'keytool -genkeypair -alias :root_ca: -dname "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: maitriacharya, C=US" -keyalg RSA -keystore proxyserver.jks -storepass {redacted) -keypass {redacted) -validity 7 -ext bc:c' failed, code: 1
Illegal option: -ext
Try keytool -help
at org.apache.jorphan.exec.KeyToolUtils.genkeypair(KeyToolUtils.java:168)
at org.apache.jorphan.exec.KeyToolUtils.generateProxyCA(KeyToolUtils.java:230)
at org.apache.jmeter.protocol.http.proxy.ProxyControl.initDynamicKeyStore(ProxyControl.java:1281)
at org.apache.jmeter.protocol.http.proxy.ProxyControl.initKeyStore(ProxyControl.java:1208)
at org.apache.jmeter.protocol.http.proxy.ProxyControl.startProxy(ProxyControl.java:434)
at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.startProxy(ProxyControlGui.java:485)
at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.actionPerformed(ProxyControlGui.java:370)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6516)
Ensure you have a JDK available and that you're using it to run JMeter.
Also ensure that keytool command line has the "-ext" option, you need JDK 7u50 as a minimum, see:
https://bugs.java.com/view_bug.do?bug_id=6780416
Note Java 8 is required since JMeter 3.2.
I recently downloaded and installed Jmeter 2.11. afterwards I tried the record functionality of the program, but that resulted in an error message:
“Could not create script recording proxy – see log for detail”.
I have try modifying the “environment variables”, but that does not help.
In the Log from the application the following message was shown.
2014/08/19 10:23:02 WARN - jmeter.protocol.http.proxy.ProxyControl: Could not open/read key store C:\apache-jmeter-2.11\bin\proxyserver.jks (The system cannot find the file specified)
2014/08/19 10:23:02 INFO - jmeter.protocol.http.proxy.ProxyControl: Creating Proxy CA in C:\apache-jmeter-2.11\bin\proxyserver.jks
2014/08/19 10:23:02 ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Command :'keytool -genkeypair -alias :root_ca: -dname "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: TATG, C=US" -keyalg RSA -keystore proxyserver.jks -storepass {redacted) -keypass {redacted) -validity 7 -ext bc:c' failed, code: 1
Illegal option: -ext
Try keytool -help
at org.apache.jorphan.exec.KeyToolUtils.genkeypair(KeyToolUtils.java:168)
at org.apache.jorphan.exec.KeyToolUtils.generateProxyCA(KeyToolUtils.java:230)
I notice the proxyserver.jks is missing under the bin directory.
How can I resolve this problem or get a copy of this file(ie. hack the directory)?
Read this, it answers exactly this issue:
https://wiki.apache.org/jmeter/TestRecording210
I have not set java_home and I need to know where the c:\Windows\System32\java.exe file points to.
I have several JDKs and JREs on my system.
The reason is that I am trying to connect via SSL to some server and it works in Netbeans after I export the certificate in the appropriate JRE (which I can see via Netbeans options)
However, when I connect via command-line, I get an SSL error. I tried adding the certificate to all my JREs but I cannot get it to work. I think it is a problem that this Windows shortcut points to some place I overlooked.
Is there an easy way to find out which JRE is the default one?
[EDIT] Or rather I need to find the location of the default keystore in the default JRE.
[EDIT] My problem is elaborated below:
the following two give SSL error:
"c:\Program Files\Java\jre6\bin\java.exe" -cp myjar.jar mypackage.myclass
"c:\Program Files (x86)\Java\jre6\bin\java.exe" -cp myjar.jar mypackage.myclass
The following two work
"c:\Program Files\Java\jdk1.6.0_24\bin\bin\java.exe" -cp myjar.jar mypackage.myclass
"c:\Program Files (x86)\jdk1.6.0_24\bin\jre6\bin\java.exe" -cp myjar.jar mypackage.myclass
I have exported the certificate using all four commands:
"c:\Program Files\Java\jdk1.6.0_24\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
"c:\Program Files (x86)\Java\jdk1.6.0_24\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
"c:\Program Files\Java\jre6\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
"c:\Program Files (x86)\Java\jre6\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
So it seems that the keytool uses a different store than java.exe.
would appreciate some help on this.
I found the solution. Thanks to this link.
It mentioned the location of the keystore. Surprisingly it took a bit of Googling.
The location is jre6\lib\security\cacerts
so I had to use the following command to import the certificate:
keytool.exe -import -alias myalias -file mycertfile -keystore "c:\Program Files\Java\jre6\lib\security\cacerts"
You should look at the "Java Application Runtimes Setting" from the Java tab of the Java Control Panel.
http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/jcp.html
From this tab, you can disable/enable any running version and you can see what is the current system JVM version...