HTTPS requests are not detected if running under mod_wsgi
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
ZPublisher/
if 'HTTPS' in environ and (environ['HTTPS'] == "on" or environ['HTTPS'] == "ON"):
However mod_wsgi version 3.3 constructs the following environment
{'DOCUMENT_ROOT': '/etc/apache2/
'GATEWAY_
'HTTPS': '1',
'HTTP_ACCEPT': 'text/html,
'HTTP_ACCEPT_
'HTTP_ACCEPT_
'HTTP_CONNECTION': 'keep-alive',
'HTTP_COOKIE': 'tree-s=
.........}
So the detection does not work and all generated links have 'http' instead of 'https'
Changed in zope2: | |
importance: | Undecided → Medium |
milestone: | none → 2.13.14 |
status: | New → Fix Committed |
Changed in zope2: | |
status: | Fix Committed → Fix Released |
I changed at my installation the following at HTTPRequest.py and it works
other[ 'SERVER_ URL'] = server_url = server_url.strip()
protocol = 'https' PORT_SECURE' in environ and
environ[ 'SERVER_ PORT_SECURE' ] == "1"):
@@ -384,7 +387,7 @@
else:
if 'HTTPS' in environ and (
- environ['HTTPS'] == "on" or environ['HTTPS'] == "ON"):
+ environ['HTTPS'] == "on" or environ['HTTPS'] == "ON" or environ['HTTPS'] == '1'):
elif ('SERVER_