Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 3 product line. The current stable release is 3.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 120096

Summary: mod_ssl environment variables not available in mod_rewrite rules
Product: Red Hat Enterprise Linux 3 Reporter: Dustin Mollo <mollo>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 3.0CC: eric.eisenhart
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-18 03:09:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 116727    
Attachments:
Description Flags
patch for httpd.conf
none
patch for ssl.conf none

Description Dustin Mollo 2004-04-05 22:47:12 UTC
Description of problem:

SSL environment variables are not accessable in mod_rewrite rules.

Version-Release number of selected component (if applicable):

httpd-2.0.46-32.ent
mod_ssl-2.0.46-32.ent

How reproducible:

100%

Steps to Reproduce:

1. edit httpd.conf as per attached diff.
2. edit /etc/httpd/conf.d/ssl.conf as per attached diff.
3. service httpd restart
4. try accessing http://your-server.com/
  
Actual results:

firefox (and any other browser you point) gets stuck in an infinite
redirect because the variable is never getting set.

Expected results:

you should simply end up at https://your-server.com/

Additional info:

this rewrite rule *should* work as per the httpd.conf snippet at:
http://httpd.apache.org/docs-2.0/ssl/ssl_howto.html#intranet

i've tried using HTTPS, SSL:HTTPS, SSL_HTTPS and ENV:HTTPS as
variables to test to see if HTTPS is being used for the connection and
all produce the recursive redirect problem.  there is a relavent
thread on the apache development list:
http://www.mail-archive.com/dev@httpd.apache.org/msg19881.html

i wasn't sure if they were suggesting that all of the above methods
i've tried are currently broken, or if the SSL:XXX version should work
and the others don't.  either way, it seems this is a big problem with
redhat's shipped version of apache.

Comment 1 Dustin Mollo 2004-04-05 22:47:53 UTC
Created attachment 99127 [details]
patch for httpd.conf

Comment 2 Dustin Mollo 2004-04-05 22:48:20 UTC
Created attachment 99128 [details]
patch for ssl.conf

Comment 3 Joe Orton 2004-04-06 07:59:41 UTC
Thanks for the report.  The configuration which does currently work is:

RewriteCond %{LA-U:ENV:HTTPS} !=on

For a future update we are planning to restore support for %{HTTPS}
and add support for the new fast %{SSL:...} variable lookup.


Comment 4 Joe Orton 2004-06-24 21:41:56 UTC
As above, for the next mod_rewrite has been extended to support:

  RewriteCond %{SSL:...} ...

for direct SSL variable lookup, along with restored support for
%{HTTPS}.  "SSLOptions +StdEnvVars" is not required for these
expansions to work.

Test packages are available at:

http://people.redhat.com/jorton/Taroon-httpd/


Comment 5 Jay Turner 2004-08-18 03:09:46 UTC
Fix confirmed with httpd-2.0.46-32.ent.  Closing out.

Comment 6 Josh Bressers 2004-09-01 18:55:40 UTC
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-349.html