tjg184 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

proxy to https target fails w/ org.apache.commons.httpclient.ProtocolException #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a rule that proxyies to a https url like so:
    <rule>
        <from>^/foo/(.*)$</from>
        <to type="proxy" last="true">https://zot.com/$1</to>
    </rule>

2. Exercise the rule by going to /foo on the urlrewrite server.

What is the expected output? What do you see instead?

Expect to see the output of https://zot.com, instead get 
org.apache.commons.httpclient.ProtocolException: The server zot.com failed to 
respond with a valid HTTP response
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1846)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at org.tuckey.web.filters.urlrewrite.RequestProxy.execute(RequestProxy.java:124)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:277)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
.
.
.

What version of the product are you using? On what operating system?
I initially found the issue on urlrewritefilter-3.2.0 but problem remained 
after upgrading to 4.0.0 from svn trunk.

This was specifically showing up on a Centos 5.3 64-bit server running 
atlassian jira version 3.12.2 with jakarta-commons-httpclient-3.0.1-3.jpp5 and 
java 1.6.0_03-b05.  

Please provide any additional information below.
I traced this to a line in RequestProxy.java.  Not having https support makes 
it tough to solve cross-domain scripting issues in a https environment.  Patch 
is attached.

Original issue reported on code.google.com by sakow...@gmail.com on 31 Aug 2010 at 7:48

Attachments:

GoogleCodeExporter commented 9 years ago
Same problem here, exactly.  Going to try patch.  I believe this would be an 
important fix.

Original comment by pietro5...@gmail.com on 5 Nov 2010 at 6:46

GoogleCodeExporter commented 9 years ago
Fixed in SVN.  Please verify this works ok.  Will be released in 4.0.2.

Original comment by p...@tuckey.org on 25 Jun 2012 at 2:03