improved ssl-check

This commit is contained in:
lars 2006-12-13 13:37:38 +00:00
parent 3e1bfda98e
commit b16c0937f9

View file

@ -408,18 +408,13 @@ class WebInterfaceSites:
if cherrypy.request.scheme == "https": if cherrypy.request.scheme == "https":
return True return True
## check an environment setting - this is quite common behind proxies ## check an environment setting - this is quite common behind proxies
try: if os.environ.has_key("HTTPS"):
if os.environ["HTTPS"]: return True
return True ## this arbitrarily chosen header must be documented in README.proxy
except KeyError: #TODO: check http://jamesthornton.com/writing/openacs-pound.html for this
## check http header for ssl information if cherrypy.request.headers.has_key("X-SSL-Request") \
#TODO: (check pound for the name) and (cherrypy.request.headers["X-SSL-Request"] == "1"):
try: return True
if cherrypy.request.headers["XXX"]:
return True
except KeyError:
## the connection seems to be unencrypted
return False
def __set_web_lang(self, value): def __set_web_lang(self, value):