Bug 44622

Summary: POST fails to SSL vhost with proxy to HTTP backend
Product: Apache httpd-2 Reporter: Nick Hengeveld <nickh>
Component: AllAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED LATER    
Severity: normal Keywords: MassUpdate
Priority: P2    
Version: 2.2.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Nick Hengeveld 2008-03-17 18:12:10 UTC
I have an Apache server that uses mod_rewrite to proxy incoming requests to one of several backend HTTP servers based on incoming request headers.  Most requests work correctly but one particular multipart/form-data POST always fails if the vhost accepting the request is using SSL.  One of the requests that works fine is another multipart/form-data POST formatted in a very similar way.

I have reproduced the error using Apache 2.2.3 from CentOS 5.1 (RPM version httpd-2.2.3-11.el5.centos) and with a fresh RPM build from the current 2.2.8 source.

The server configuration contains the following (some server and log paths changed):

Listen 30100
<VirtualHost _default_:30100>
    ServerName server.reactrix.com
    ErrorLog /path/to/logs/apache-error_log
    CustomLog /path/to/logs/apache-access_log reactrix
 
    SSLEngine on
    SSLVerifyClient require
    SSLVerifyDepth 10
    SSLCertificateFile /path/to/ssl/server.crt
    SSLCertificateKeyFile /path/to/ssl/server.key
    SSLCACertificatePath /path/to/ssl/
 
    RewriteEngine on
    RewriteOptions inherit

    <Directory /path/to/git/>
        Options -indexes
        order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Listen 8100
<VirtualHost _default_:8100>
    ServerName server.reactrix.com
    ErrorLog /path/to/logs/apache-error_log
    CustomLog /path/to/logs/apache-access_log reactrix

    RewriteEngine on
    RewriteOptions inherit

    <Directory /path/to/git/>
        Options -indexes
        order allow,deny
        allow from all
    </Directory>
</VirtualHost>

The request I am trying to send (some headers removed) is:

POST http://server.reactrix.com/path/to/upload
Host: server.reactrix.com
Content-Length: 465
Content-Type: multipart/form-data; boundary=xYzZY

--xYzZY
Content-Disposition: form-data; name="upload[handle]"

handle
--xYzZY
Content-Disposition: form-data; name="upload[display_id]"

1
--xYzZY
Content-Disposition: form-data; name="upload[controller_id]"

1
--xYzZY
Content-Disposition: form-data; name="upload[file]"; filename="/tmp/file.png"
Content-Type: application/gzip

ë
¼Cçåâb``àõôp  b``²ïp ¾×ÝT°§cHÅ­·
   ¾úçòò/` 4¤3¬a`ìOõX  âzºú¹¬sJh\³ûu
--xYzZY--

When I send the above request to the SSL listener on port 30100, I get the following response (some headers removed):

HTTP/1.1 404 Not Found
Connection: close
Date: Tue, 18 Mar 2008 00:21:42 GMT
Via: 1.1 127.0.0.1:30100
Content-Length: 0
Content-Type: text/plain
Client-Date: Tue, 18 Mar 2008 00:21:15 GMT
Client-Response-Num: 1

When I send the same request to the listener on port 8100, I get the following response (some headers removed):

HTTP/1.1 200 OK
Cache-Control: no-cache
Connection: close
Date: Tue, 18 Mar 2008 00:24:59 GMT
Via: 1.1 127.0.0.1:8100
Server: Mongrel 1.1.2
Content-Length: 16
Content-Type: text/html
Client-Date: Tue, 18 Mar 2008 00:24:32 GMT
Client-Response-Num: 1
Set-Cookie: _session_id=3368cec4d8f4f2c3f7f8e1ecc63dc86a; path=/
Status: 200 OK

Upload succeeded
Comment 1 Ruediger Pluem 2008-03-18 00:59:54 UTC
1. Please set the loglevel to debug and post the snippets of the error_log here (from both virtual hosts, plus the global one).
2. Have you tried if it works when you remove the authentication via client certificates in the SSL virtual host?
Comment 2 William A. Rowe Jr. 2018-11-07 21:09:34 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.