elie
elie

Reputation: 59

JMETER - Using recorder for HTTPS requests for an IP adress (instead of a domain name)

I have some load testing to do. My web application does not have a domaine name (only an IP adress) and uses HTTPS.

When try to top use JMeter's Script Recorder, I get the following error in my web browser:

An error occurred during a connection to 188.165.49.217:8443. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

And if I look at JMeter's log I see the following:

Problem with keystore
java.io.IOException:   >> erreur keytool : java.lang.RuntimeException: 
java.io.IOException: DNSName components must begin with a letter <<
Command failed, code: 1
'"C:\Program Files (x86)\Java\jre1.8.0_121\bin\keytool" -genkeypair -alias 1XX.XXX.XX.XXX -dname "cn=1XX.XXX.XX.XXX, o=JMeter Proxy (TEMPORARY TRUST ONLY)" -keyalg RSA -keystore proxyserver.jks -storepass {redacted} -keypass {redacted} -validity 7 -ext san=dns:1XX.XXX.XX.XXX'
    at org.apache.jorphan.exec.KeyToolUtils.genkeypair(KeyToolUtils.java:171) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jorphan.exec.KeyToolUtils.generateSignedCert(KeyToolUtils.java:285) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jorphan.exec.KeyToolUtils.generateHostCert(KeyToolUtils.java:276) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.updateKeyStore(ProxyControl.java:1563) ~[ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.Proxy.getSSLSocketFactory(Proxy.java:324) [ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.Proxy.startSSL(Proxy.java:429) [ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:194) [ApacheJMeter_http.jar:4.0 r1823414]
2018-04-16 17:33:24,397 WARN o.a.j.p.h.p.Proxy: [61014]  Unable to negotiate SSL transaction, no keystore?
2018-04-16 17:33:24,397 ERROR o.a.j.p.h.p.Proxy: [61014]  Exception when processing sample java.io.IOException: Unable to negotiate SSL transaction, no keystore?
        at org.apache.jmeter.protocol.http.proxy.Proxy.startSSL(Proxy.java:446) ~[ApacheJMeter_http.jar:4.0 r1823414]
        at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:194) [ApacheJMeter_http.jar:4.0 r1823414]
2018-04-16 17:33:24,398 WARN o.a.j.p.h.p.Proxy: [61014]  Exception while writing error java.net.SocketException: Connection reset by peer: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_121]
    at java.net.SocketOutputStream.socketWrite(Unknown Source) ~[?:1.8.0_121]
        at java.net.SocketOutputStream.write(Unknown Source) ~[?:1.8.0_121]
        at java.io.DataOutputStream.writeBytes(Unknown Source) ~[?:1.8.0_121]
        at org.apache.jmeter.protocol.http.proxy.Proxy.writeErrorToClient(Proxy.java:561) 
[ApacheJMeter_http.jar:4.0 r1823414]
        at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:258)     [ApacheJMeter_http.jar:4.0 r1823414]

The way I see it, the JMeterScript Recorder does not accept IP adresses for HTTPS recording, Am I right? Is there any way to around that (besides usin a domain name for my we app)?

Regards Elie

Upvotes: 1

Views: 1311

Answers (2)

Abolfazl Hashemi
Abolfazl Hashemi

Reputation: 764

Since version 5.1 of apache-jmeter, this problem has been resolved and you can enter IP or domain name that starts with digits.

Upvotes: 0

0xadecimal
0xadecimal

Reputation: 726

One option would be to modify the hosts file on the server that jmeter is running on so that jmeter can resolve the domain name. You can find information on how to modify the hosts file for your operating system here.

Upvotes: 1

Related Questions