httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50481] mod_proxy with SSLProxyEngine truncates files fetched with chunked encoding
Date Wed, 15 Dec 2010 16:33:28 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50481

--- Comment #1 from Filipe Brandenburger <filbranden@gmail.com> 2010-12-15 11:33:25
EST ---
Created an attachment (id=26411)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26411)
Test case for the bug

This attachment contains all the files needed to reproduce the bug, the output
of tests done with "curl" showing the problem and also the error_log generated
with mod_dumpio and LogLevel debug showing the problem.

To run the dummy webservers:
1. cd dummyws
2. Generate self-signed openssl certificates in server.key and server.crt
3. Run ./dummy_webserver_chunked_works.py, it will listen on port 8443
4. Ctrl+C to stop it.
5. Run ./dummy_webserver_chunked_breaks_apache.py, it will also listen on port
8443 (you run either one or the other.)

I reproduced this issue with many different Apache servers (the one included in
CentOS 5 as well). I included the modified httpd.conf for the vanilla 2.2.17 I
compiled in install/conf/httpd.conf inside the tgz, but other than enabling
debug, these are the only two lines that are needed (or a similar one adjusting
the proxy URLs):

SSLProxyEngine on
ProxyPass /test https://localhost:8443/

I also set up my Apache in port 8080, if you decide to use a different port
then adapt client.sh accordingly.

Next step is to run the tests.
1. cd client
2. Make sure Apache is up and ./dummy_webserver_chunked_works.py is running.
3. Run ./client.sh works
4. This will generate files output_dummy_works.txt and output_proxy_works.txt
5. Stop ./dummy_webserver_chunked_works.py and start
./dummy_webserver_chunked_breaks_apache.py instead.
6. Run ./client.sh breaks_apache
7. This will generate files output_dummy_breaks_apache.txt and
output_proxy_breaks_apache.txt

Looking at the contents of the .txt files, you will see that all of them
contain the two lines "First 16 chars" and "Last  16 chars", except for
output_proxy_breaks_apache.txt which goes through the Apache proxy, in that
case it will contain only the line "First 16 chars". Note that the same access
going from curl directly to the dummy webserver does not show this problem,
curl correctly understands the split chunked length. I tried the same in
Firefox and had the same results, if I access the
./dummy_webserver_chunked_breaks_apache.py server on port 8443 with Firefox it
shows the content correctly, if I go through the Apache proxy on port 8080 I
get the truncated output.

In directory install/logs are two snippets of Apache's error_log with LogLevel
debug and mod_dumpio activated for both input and output.

In file error_log_works.txt you will find the following:

[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 4 bytes
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): 10\r\n
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[readbytes-nonblocking] 16 readbytes
...
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 16 bytes
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): First 16 chars\r\n
...
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-nonblocking] 0 readbytes
...
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 2 bytes
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): \r\n
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-nonblocking] 0 readbytes
...
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 4 bytes
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): 10\r\n
...
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 16 bytes
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): Last  16 chars\r\n
...
[Wed Dec 15 07:48:48 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-nonblocking] 0 readbytes

Now, in file error_log_breaks_apache.txt this is what you will see:

[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 4 bytes
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): 10\r\n
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[readbytes-nonblocking] 16 readbytes
...
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 16 bytes
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): First 16 chars\r\n
...
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-nonblocking] 0 readbytes
...
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 2 bytes
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): \r\n
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-nonblocking] 0 readbytes
...
[Wed Dec 15 07:49:39 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
...
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 3 bytes
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): 0\r\n         <<<<<============================
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 16 bytes
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): Last  16 chars\r\n
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(55): mod_dumpio:  dumpio_in
(data-TRANSIENT): 2 bytes
[Wed Dec 15 07:49:40 2010] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in
(data-TRANSIENT): \r\n

As you can see, the "1" is getting eaten by Apache somewhere.

We are worried that this problem might affect other pages, so I'll be looking
at a way to fix Apache here, if I come up with a patch I'll post it here in
this bug, but I would appreciate it if you could also have a look and see if
you can find the issue (you can certainly find the issue easier than I can).

Thanks,
Filipe

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message