Getting connection abort and fatal alert error while recording in jmeter - jmeter

I am unable to record a script using JMeter and getting connection abort and fatal alert.
JMeter log:
2018-02-13 13:41:24,653 WARN o.a.j.p.h.p.Proxy: [54571] Problem with SSL certificate for url for 'api.amplitude.com'? Ensure browser is set to accept the JMeter proxy cert: Software caused connection abort: recv failed
2018-02-13 13:41:39,823 WARN o.a.j.p.h.p.Proxy: [54636] Problem with SSL certificate for url for 'api.amplitude.com'? Ensure browser is set to accept the JMeter proxy cert: Received fatal alert: unknown_ca
2018-02-13 13:41:40,868 WARN o.a.j.p.h.p.Proxy: [54650] Problem with SSL certificate for url for 'code.jquery.com'? Ensure browser is set to accept the JMeter proxy cert: Software caused connection abort: recv failed

The main reason for this error is incorrect configuration of your browser, you need to import JMeter's self-signed certificate into the browser, the file is called ApacheJMeterTemporaryRootCA.crt and it's generated in "bin" folder of your JMeter installation when you launch HTTP(S) Test Script Recorder. See HTTPS recording and certificates chapter of JMeter User Manual for more information on the concept and instructions on how to install JMeter's certificate into different browsers. I would also recommend checking out Recording HTTPS Traffic with JMeter's Proxy Server article for more details.
If your application doesn't use HTTPS and the call to api.amplitude.com is generated as a result of parsing embedded resources you can simply exclude this URL from recording by adding it to URL Patterns to Exclude field of the HTTP(S) Test Script Recorder like:

Related

JMeter: Connection Timed out error in JMeter script

I am trying to create a JMeter script for an application hosted in public cloud. But when I try to record or replay, the connection to site fails with following error. But the same site/application works via browser with no issues.
I have already tried launching the JMeter using the PROXY host & port (since I am behind a enterprise proxy/firewall), but it did not work. Any suggestions/workarounds help. Thanks in advance.
Error: org.apache.http.conn.HttpHostConnectException: Connect to [XXXXXXXXXXXXXXXXXX] failed: Connection timed out: connect
Your error message means that the connection attempt to the website fails due to timeout, but we cannot comment what exactly needs to be done unless we see more detailed stacktrace.
You could try:
Enabling Java debug logging for HTTPS connections by adding the next line to system.properties file:
javax.net.debug=all
Enable JMeter debug logging for HTTP components by adding the next line to log4j2.xml file:
<Logger name="org.apache.http" level="debug" />
If the proxy is really "enterprise" you might need to set your domain via http.proxyDomain JMeter property

Jmeter - Non HTTP response message: Received fatal alert: handshake_failure

Am trying to automate API in Jmeter, wherein getting below error message,
Response code: Non HTTP response code: javax.net.ssl.SSLHandshakeException
Response message: Non HTTP response message: Received fatal alert: handshake_failure
The same request is working fine in Postman, there is a client certificate generated in .CRT or .P79 formats.Also in postman > Certificates i configured Host , CRT file , KEY file, wanted to know in Jmeter where/how we can configure these.
Note : was not able to use openssl and Keytool as am not allowed to install in client machine.
JMeter can only send client certificates if they're present in a Java Keystore
So you need to convert your .crt certificate into .jks or .p12 Java Keystore and tell JMeter where the keystore is located and what is the password using javax.net.ssl.keyStore and javax.net.ssl.keyStorePassword JMeter System Properties like it's described in How to Set Your JMeter Load Test to Use Client Side Certificates article.
If you're not capable of installing OpenSSL and/or Keytool to the machine where JMeter lives you can use online certificate conversion solutions like:
SSL Converter by SSHShopper
SSL Converter by NameCheap

How to integrate client certificate with jmeter

I am facing issue with the execution of the APIs in Jmeter. Our APIs have client certificate in .pfx format. I have converted the same in .jks and updated the same in the system.properties of jmeter. In jmeter I have created a csv file to pick up the created alias. However, the error is shown as
Error:
Response message: Non HTTP response message: java.lang.IllegalArgumentException: No certificate found for alias:'certalias'
Below is my alias info:
Alias name: certalias
Creation date: Nov 8, 2018
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Jmeter Log:
2018-11-13 11:16:08,949 WARN o.a.j.u.SSLManager: Keystore file not found, loading empty keystore
Can you please help me with the integration of our client certificate with the Jmeter.
Thanks in advance.
I don't think you need to convert the .pfx into as .pfx is a PKCS12 certificate type and JMeter should support it out of the box.
Make sure to add the next lines to system.properties file:
javax.net.ssl.keyStore=your_certificate.pfx
javax.net.ssl.keyStorePassword=your_certificate_password
javax.net.ssl.keyStoreType=pkcs12
JMeter restart will be required to pick the properties up.
If you have > 1 certificates in the keystore you can select the exact certificate(s) by setting the following properties
https.keyStoreStartIndex=0
https.keyStoreEndIndex=0
By default JMeter will go for the first certificate in the keystore, if your certalias is not the first - amend the properties accordingly.
More information: How to Set Your JMeter Load Test to Use Client Side Certificates

Gradle : Unable to tunnel through proxy

I am trying to run a blank Flutter project behind a corporate proxy requiring basic authentication and self-signing HTTPS connections.
I added the necessary config in ~/.gradle/gradle.properties and in ~/.profile. I also imported my root certificate in $JAVA_HOME/jre/lib/security/cacerts and told Gradle to use it. I even tried this solution and set java.net.useSystemProxies=true in $JAVA_HOME/jre/lib/net.properties.
But, still, it doesn't build, and it asks for authentication.
flutter run
Launching lib/main.dart on Nexus 5 in debug mode...
Initializing gradle... 0.8s
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: ~/GitLab/n.gendron/techno_store/android/gradlew app:properties:
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-2.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
Failed to download any source lists!
This guide helped me a lot trough this process, and this one helped me import the CA, but now I'm stuck.
Any idea?
You need in gradle/gradle.properties write:
# Project-wide Gradle settings.
...
systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=443
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.auth.ntlm.domain=domain
systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=443
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.auth.ntlm.domain=domain
...

JMeter (Active?) FTP to VLTrader

Situation:
I'm using JMeter to load test my communications application (Cleo VLTrader). I'm new to JMeter, and have been able to get HTTP communication working, but not FTP. When I attempt to use a JMeter FTP Request sampler, I can see on the server side that the JMeter is issuing a "PASV" command, and failing shortly thereafter due to a "502 PASV command not available" error.
Question:
How do I need to configure my JMeter FTP Request sampler to connect to my FTP server?
1. Sorry for this but just to ensure: have you ensured that FTP connection succeeds manually, i.e. not from FTP Request in jmeter script but via console/telnet connection or any FTP client utility?
2. FTP Passive mode
Possible cause:
Since your FTP Request fails during PASV command execution can suppose that the root cause is that your ftp server doesn't support passive mode while jmeter's FTP Request uses passive mode by default.
To ensure this try to switch into Passive mode after connecting to your ftp from console,
e.g.
telnet your.ftp.server.url 21
USER yourusername
PASS yourpassword
PASV
or
ftp -d your.ftp.server.url
USER yourusername
PASS yourpassword
passive
or using any ftp client utility which have option to select mode (active/passive) for connection.
If the same issue appears during this - well, the problem is that your ftp server doesn't support passive mode which is used by FTP Request.
See e.g. this for explanation of differences in both the modes.
Possible solution:
As per jmeter sources:
ftp.enterLocalPassiveMode();
switch to passive mode is used by default and there is no possibility to set mode externally in FTP Request configuration screen.
But you can implement ftp request yourself, avoiding usage of FTP Request.
You can use FTPClient realization from Apache Commons Net and script ftp connection in BeanShell Sampler.
Very simplified this may look like:
import org.apache.commons.net.ftp.*;
FTPClient client = new FTPClient();
client.setDataTimeout(3600000);
client.connect(ftpHost,ftpPort);
client.login(userName, userName);
client.setFileType(FTPClient.BINARY_FILE_TYPE);
...
// FTPClient uses 'active mode' by default
if (ftp_passive_mode) {
client.enterLocalPassiveMode();
} else {
client.enterLocalActiveMode();
}
...
client.logout();
client.disconnect();
Maybe also I'm wrong and the reason of your issue hides in another place.
Hope this will help you to diagnose and solve your problem.

Resources