Bug 39337 - POST requests over https through a proxy generate invalid CONNECT requests
Summary: POST requests over https through a proxy generate invalid CONNECT requests
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.1.1
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2006-04-18 11:50 UTC by Stefan Fritsch
Modified: 2007-08-20 05:17 UTC (History)
0 users

sample request (521 bytes, text/plain)
2006-04-18 11:54 UTC, Stefan Fritsch

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Fritsch 2006-04-18 11:50:22 UTC
When issuing a POST request over https through a proxy, jmeter adds the
Content-Length: header fromo the POST request to the CONNECT request to the
proxy. This is invalid. Some proxies (but not squid) will then wait for the
content while jmeter waits for the "200 Connection established" message from the
proxy. The connection hangs.

A sample request from a tcpdump is attached.
Comment 1 Stefan Fritsch 2006-04-18 11:54:58 UTC
Created attachment 18124 [details]
sample request
Comment 2 Sebb 2006-04-30 16:45:22 UTC
Which HTTP sampler did you use - was that the default, or Apache HTTPClient?
Comment 3 Stefan Fritsch 2006-05-02 14:22:36 UTC
(In reply to comment #2)
> Which HTTP sampler did you use - was that the default, or Apache HTTPClient?

Where can I see that? I found 

<stringProp name="TestElement.test_class">org.apache.jmeter.protocol.

in the test plan file.
Comment 4 Sebb 2006-05-02 16:38:07 UTC
It says "HTTP Request HTTPClient" on the GUI if you are using the new sampler, 
otherwise just "HTTP Request"

The Apache classname is HTTPSampler2, so you are using the default (Java) 

Does the problem also occur with HTTP requests?
Comment 5 Stefan Fritsch 2006-05-16 13:26:08 UTC
It works with http. In this case, it sends the POST request with all headers 
directly to the proxy server, which is correct. There is no CONNECT request 
with http. 
Comment 6 Sebb 2006-05-17 22:37:22 UTC
The HTTPSampler does not do any special processing to handle proxy servers. It
does not issue a CONNECT request, as far as I can see.

This is all handled by the Java HTTP implementation, so it would seem that the
problem is in the Java code.

Not sure what to suggest.

It's possible that JMeter is generating the headers incorrectly for use with
HTTPS over a proxy, but somehow the same headers are OK for HTTP+proxy.

I've no idea what to change to fix this.
Comment 7 Stefan Fritsch 2006-05-20 07:47:52 UTC
Ohh, you are right, this is a java problem. After some more googling I found 
these bug reports:


The first one seems to imply that it is fixed in java 1.5.

Thanks for looking into it.
Comment 8 Sebb 2006-05-20 08:31:25 UTC
Thanks for the bug pointers. I'll see about adding a note to the documentation.

If you can't upgrade to 1.5, or that does not work either, you could try using
the Apache HTTPClient implementation instead. There are some issues with this in
2.1.1 which are fixed in the current nightly, so you may need to use that.
Comment 9 Sebb 2007-08-20 05:17:37 UTC
Updated Changes/"known bugs" to reference this bug.