Bug 47928 - CONNECT requests get fully qualified and therefore do not work
Summary: CONNECT requests get fully qualified and therefore do not work
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.2.14
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2009-10-01 15:31 UTC by billz
Modified: 2009-11-02 14:06 UTC (History)
0 users



Attachments
Do not fully qualify the substitution string for CONNECT method (389 bytes, patch)
2009-10-01 15:44 UTC, billz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description billz 2009-10-01 15:31:39 UTC
When mod_rewrite proxies a CONNECT request, it fully qualifies the substitution string.  The result is a failed connection to the originally requested server instead of the proxy server.

TEST CASE:
curl -x http://myproxyserver.com:9080 https://mysslserver.com

EXAMPLE APACHE CONFIG:
Listen 9080
NameVirtualHost *:9080
<VirtualHost *:9080>
    ServerName myproxyserver.com
    AllowCONNECT 8888
    RewriteEngine On

    RewriteCond %{REQUEST_METHOD} ^CONNECT$ [NC]
    RewriteCond %{HTTP_HOST} ^mysslserver.com:443$
    RewriteRule ^(.*)$ myqasslserver.com:8888 [P]
</VirtualHost>

RESULT:
The method fully_qualify_uri changes the substitution string from: 
myqasslserver.com:8888
to: 
http://mysslserver.com:443/myqasslserver.com:8888
Comment 1 billz 2009-10-01 15:44:19 UTC
Created attachment 24329 [details]
Do not fully qualify the substitution string for CONNECT method
Comment 2 Graham Leggett 2009-10-05 14:22:10 UTC
Applied to httpd-trunk in r822004.
Comment 3 billz 2009-10-26 09:56:11 UTC
Is there a way to get this committed to the 2.2.x branch also?

That's what the patch was created against.

(In reply to comment #2)
> Applied to httpd-trunk in r822004.
Comment 4 Ruediger Pluem 2009-10-26 13:19:13 UTC
(In reply to comment #3)
> Is there a way to get this committed to the 2.2.x branch also?
> 

See http://svn.apache.org/viewvc?rev=829677&view=rev
Comment 5 Stefan Fritsch 2009-11-02 14:06:43 UTC
backported to 2.2.x in r832124, will be in 2.2.15