Mailing List Archive

[Bug 9234] New: - Redirect URL incorrectly contains extra characters when there is a SSL virtual host
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9234>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9234

Redirect URL incorrectly contains extra characters when there is a SSL virtual host

Summary: Redirect URL incorrectly contains extra characters when
there is a SSL virtual host
Product: Apache httpd-2.0
Version: 2.0.36
Platform: PC
OS/Version: Linux
Status: NEW
Severity: Major
Priority: Other
Component: mod_ssl
AssignedTo: bugs@httpd.apache.org
ReportedBy: ltsang@gothamrm.com


Setting:
My test http.conf has 3 virtual host entries:
<VirtualHost *>
ServerName ssl.host.com:443
SSLEngine on
</VirtualHost *>
<VirtualHost *>
ServerName oldbox.host.com
Redirect / http://newbox.host.com/
</VirtualHost *>
<VirtualHost *>
ServerName newbox.host.com
...
</VirtualHost *>

Problem 1:
When I try to hit it like this:
# telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
GET / HTTP/1.0
Host: oldbox.host.com

I get this response (NOTE the incorrect URL in the Location field):
HTTP/1.1 302 Found
Date: Sun, 19 May 2002 12:28:11 GMT
Server: Apache/2.0.36 (Unix) mod_ssl/2.0.36 OpenSSL/0.9.6b DAV/2
Location: http://newbox.host.com/mod_ssl:error:HTTP-request
Content-Length: 321
Content-Type: text/html; charset=iso-8859-1

...

Problem 2:
If I change the Redirect directive to this:
Redirect /test.html http://newbox.host.com/test.html

I get a different response:
HTTP/1.1 400 Bad Request
Date: Sun, 19 May 2002 12:36:33 GMT
Server: Apache/2.0.36 (Unix) mod_ssl/2.0.36 OpenSSL/0.9.6b DAV/2
Vary: accept-language
Accept-Ranges: bytes
Content-Length: 725
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Expires: Sun, 19 May 2002 12:36:33 GMT

And the error-log has these entries:
[Sun May 19 08:36:33 2002] [error] mod_ssl: SSL handshake failed: HTTP spoken
on HTTPS port; trying to send HTML error page (OpenSSL library error follows)
[Sun May 19 08:36:33 2002] [error] OpenSSL: error:1407609C:lib(20):func
(118):reason(156)

Problem 3:
However, if I change the order of the virtual host sections in the http.conf
and move the first virtual host (SSL) to be the last of the three, then the
redirect works perfectly.

I tried issuing "SSLEngine off" for the other virtual hosts, but that does not
fix the problem.

-lawrence

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