HTTP(S) Test Script Recorder and HTTP CONNECT verb

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

HTTP(S) Test Script Recorder and HTTP CONNECT verb

Selig-Smith, Colin
Hi,

I've been trying to record some browser requests, using the jmeter proxy and am having problems with HTTP 1.1 CONNECT verbs.

They always fail with a certificate error. Other HTTP verbs GET/POST/OPTIONS etc are successfully proxied so I'm fairly sure the installation of the jmeter root CA cert in the browser is correct.

Is this just functionality which the jmeter proxy doesn't support? I haven't seen any indication in the release notes or documentation that it doesn't.

I'd be grateful for any help if someone has seen this before.

regards,
Colin

Versions
---------
Browser: Firefox 67.0.4 (64-bit)
Jmeter version: 5.1.1 r1855137
Java version:
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

I realise it's an elderly JDK & could use a more recent one for the jmeter instance if necessary.


e.g.

CONNECT fonts.gstatic.com:443 HTTP/1.1
CONNECT www.mozilla.org:443 HTTP/1.1

Results in
----------

Thread Name:
Sample Start: 1970-01-01 01:00:00 CET
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 856
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 856
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""):
Response code:
Response message: Received fatal alert: certificate_unknown
**ensure browser is set to accept the JMeter proxy certificate**


SampleResult fields:
ContentType:
DataEncoding: null

Example response stack traces:
--------------------------------

javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
        at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2020)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1127)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:931)
        at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
        at org.apache.jmeter.protocol.http.proxy.HttpRequestHdr.parse(HttpRequestHdr.java:138)
        at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:202)

or

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:994)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:931)
        at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
        at org.apache.jmeter.protocol.http.proxy.HttpRequestHdr.parse(HttpRequestHdr.java:138)
        at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:202)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
        at sun.security.ssl.InputRecord.read(InputRecord.java:505)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
        ... 7 more

or

javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
        at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2020)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1127)
        at sun.security.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1761)
        at sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:124)
        at sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:1152)
        at sun.security.ssl.ServerHandshaker.sendChangeCipherAndFinish(ServerHandshaker.java:1853)
        at sun.security.ssl.ServerHandshaker.clientFinished(ServerHandshaker.java:1811)
        at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:317)
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:931)
        at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
        at org.apache.jmeter.protocol.http.proxy.HttpRequestHdr.parse(HttpRequestHdr.java:138)
        at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:202)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]