From: Michael Tremer Date: Sat, 13 Jun 2015 12:45:49 +0000 (+0200) Subject: Show SSL protocol (and possibly cipher) in page footer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47d47c2e425e45674e4d21bd5bedd44e965d2316;p=ipfire.org.git Show SSL protocol (and possibly cipher) in page footer --- diff --git a/templates/base.html b/templates/base.html index e8fc6056..080ba0ca 100644 --- a/templates/base.html +++ b/templates/base.html @@ -71,6 +71,13 @@

© {{ year }} - {{ _("IPFire is free software") }} + + {% if ssl_protocol %} + • + {{ ssl_protocol }} + + {% if ssl_cipher %}({{ ssl_cipher }}){% end %} + {% end %}

diff --git a/webapp/handlers_base.py b/webapp/handlers_base.py index 765bbef3..6f1ec9d4 100644 --- a/webapp/handlers_base.py +++ b/webapp/handlers_base.py @@ -33,11 +33,18 @@ class BaseHandler(tornado.web.RequestHandler): # Remove the development prefix return self.request.host.replace(".dev.", ".") + @property + def ssl_params(self): + return { + "ssl_cipher" : self.request.headers.get("X-Https-Cipher", None), + "ssl_protocol" : self.request.headers.get("X-Https-Protocol", None), + } + @property def render_args(self): today = datetime.date.today() - return { + ret = { "format_size" : backend.util.format_size, "format_time" : backend.util.format_time, "hostname" : self.hostname, @@ -45,6 +52,9 @@ class BaseHandler(tornado.web.RequestHandler): "rss_url" : self.rss_url, "year" : today.year, } + ret.update(self.ssl_params) + + return ret def render(self, *args, **_kwargs): kwargs = self.render_args