Unable to find ApacheJMeterTemporaryRootCA.crt on Jmeter installed on Mac - jmeter

I installed Jmeter on my mac using brew. I did setup my Jmeter for script recording and started scripting recording. I got a popup saying:
Root CA certificate ApacheJMeterTemporaryRootCA created in JMeter bin directory
You can install it following instructions in Component Reference documentation
See Installing the JMeter CA certificate for HTTPS recording paragraph.
But when I looked into the Jmeter directory /usr/local/Cellar/jmeter/5.3/bin/ and
/usr/local/Cellar/jmeter/5.3/libexec/bin/, I could not find the ApacheJMeterTemporaryRootCA.
Am I looking at right place or am I missing any step?

According to the jmeter formula it should be under $HOMEBREW_PREFIX/Cellar/jmeter/$YOUR_JMETER_VERSION_HERE/libexec/bin/, the file is called ApacheJMeterTemporaryRootCA.crt.
Where $HOMEBREW_PREFIX is the environment variable, if it's not defined you can check it using brew --prefix command.
And last but not the least you can search your hard drive(s) for the certificate using find command like:
find / -type f -name ApacheJMeterTemporaryRootCA.crt
it will print the location(s) of all the file(s) matching this name which are present in your filesystem
By the way there is an alternative way of recording a JMeter test - JMeter Chrome Extension, in this case you won't have to worry about proxies and certificates, just follow your test scenario in the browser and you will be able to export the recording in form of JMeter .jmx script

Related

JMeter 5.3 doesn't respond after a click File->Open File on MacOS Monterey 12.5.1

For a few days I cannot open any JMX file in JMeter script. Even after click File->Recently Opened, JMeter opens this file but non of click action on this file doesn't work. I am using JMeter version 5.3.
What I've done:
tried to used another JMeter version (5.5)
unistalled and installed newest JDK version (17.0.4.1)
upgraded all MacOS upgraded
scanned my MACOS in order to find a viruses
opened another applications based on Java and try to open the file (f.e. Intelij)
Increased Heap from 256M to 512M
Killed all denudant processes
Opened the java logs
All these actions were unsuccessful. Slowly my ideas are ran-down. Any idea from you what else can I check?
Best regards.
I cannot reproduce your issue:
so most probably something is wrong with your Java/JMeter/OS/user/whatever.
You can try following troubleshooting steps:
Increase JMeter's logging verbosity to maximum and see whether there are any suspicious entries in jmeter.log file
Check your OS logs using Console application
Try switching to another Look and Feel via Options -> Look and Feel. If this doesn't work as well you can do it using command line i.e.
./jmeter.sh -Jjmeter.laf=CrossPlatform
Try running JMeter and providing the path to the .jmx script via -t command-line argument like:
./jmeter -t /path/to/test.jmx

JMeter Certificate "ApacheJMeterTemporaryRootCA.crt" not generated when recording test

When I launch JMeter and start a recording in the "HTTP(S) Test Script Recorder" a window pops-up indicating that a Root CA certificate has been generated in the JMeter bin directory, but when I go to the bin directory there isn't any certificate there.
I am using JMeter 5.4.1 on Windows 10.
Based on this, I tried launching JMeter with administrator permissions and checked the permissions of the bin directory but still no certificate was generated.
As suggested here, I also tried to delete the files ApacheJMeterTemporaryRootCA.crt, ApacheJMeterTemporaryRootCA.usr and proxyserver.jks from the bin directory. Afterwards, I launched JMeter again and started the recorder but still no certificate was generated.
I also tried using a different version of JMeter and downloaded version 5.4.3, but the certificate was still not generated.
[EDIT]
According to Dmitri T's suggestion, the jmeter log can be viewed here.
We cannot help without seeing your jmeter.log file, better with debug logging enabled.
Look for the following line:
ProxyControl: Created keystore in
it will contain the path where the certificates are created. If not the log file will display the error.
You may also find JMeter Chrome Extension easier to use, in this case you won't have to worry about proxies and certificates.
It seems I managed to find a solution to my problem. The value I had on the system and user variable _JAVA_OPTIONS was causing the failure. I deleted those variables and the certificate was generated again.

Jmeter cannot find keytool application and no keystore was provided. Tried alll

Im working with Jmeter, trying to running it as a proxy, but when I start recording, I got this alert. I tried setting user.properties, but i can’t find a solution. Please, so grateful if you help me!
In order to be able to record HTTPS traffic JMeter generates special MITM certificate which needs to be installed in the browser
In order to be able to generate the certificate JMeter needs keytool command which normally lives in "bin" folder of JDK or JRE
So make sure to add the "bin" folder of your Java installation to your operating system PATH and it should resolve your issue.
Example command on Windows:
setx PATH=c:\java\bin;%PATH% && jmeter.bat
Example command on Unix and derivatives:
PATH=/opt/java/bin:$PATH && ./jmeter.sh
Replace c:\java or /opt/java with the real path to your JDK or JRE installation.
You should get something like:
if you launch JMeter from the same terminal window you will be able to start the HTTP(S) Test Script Recorder without any issues
Also be aware that there is an easier way of recording a JMeter test: JMeter Chrome Extension, in this case you won't have to worry about proxies and SSL certificates

I can't get 'create-rmi-keystore.bat' to run on windows, is there a solution to this?

I am new to Jmeter 5.1.1 however I am in the process of setting up a remote testing with it.
One step I'm having trouble with is running 'create-rmi-keystore.bat' when I double click it nothing happens. I have tried to open it using the command line and get the following message.
'keytool' is not recognized as an internal or external command,
operable program or batch file.
"Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'"
I don't seem to have a rmi-keystore.jks .
Has anyone managed to solve this issue?
You don't have keytool utility in your Windows PATH, all you need to do is to ensure that it's there.
Solution using Windows Command Prompt would be:
set PATH="path\to\bin\folder\of\your\JDK\or\JRE\installation";%PATH%
In general if you don't need the secure RMI communication between JMeter master and slave machines (and 99% of people don't need this as it doesn't add any value and only creates overhead in terms of CPU and RAM) you can just disable this functionality by adding the next line to user.properties file:
server.rmi.ssl.disable=true
References:
Remote hosts and RMI configuration
Apache JMeter Properties Customization Guide
If you do this on JMeter master and all the slaves you will not have to worry about the RMI keystore, but I would still recommend having the keytool in the PATH otherwise you will not be able to use HTTP(S) Test Script Recorder for recording secure traffic.

JMeter - Error when starting test plan- keytool error: proxysever.jks (access is denied)

I am following JMeter User guide to start recording my first test plan. When I click the Start button in HTTP Test Script Recorder, I got this error:
Could not create script recorder – see log for details >> keytool error:java.io.FileNotFoundException: proxyserver.jks (Access is denied)
How could I fix this error? Thanks in advance.
Background: JMeter creates a self-signed SSL certificate in order to be able to decrypt and record HTTPS requests, this proxyserver.jks is a Java Keystore which is being generated by JMeter in its "bin" folder when you start HTTP(S) Test Script Recorder proxy
Explanation: The error you are getting most probably indicates that you don't have permissions to write anything into the "bin" folder of your JMeter installation
Workarounds:
You can try launching JMeter with elevated rights (run as administrator or superuser or whoever having write access to JMeter's "bin" folder
You can change the location where JMeter tries to generate this proxyserver.jks file by adding the next line to user.properties file:
proxy.cert.directory=/path/to/folder/where/you/have/write/access
JMeter restart will be required to pick the property up.
Another option is passing the property value via -J command-line argument like
jmeter -Jproxy.cert.directory=/path/to/folder/where/you/have/write/access -n -t ....
Check out Apache JMeter Properties Customization Guide for more information regarding JMeter properties and ways of setting and overriding them
One workaround that worked for me was to start JMeter.bat from bin folder from cmd which was "run as administrator". After this, the error was gone.

Resources