]> git.ipfire.org Git - ipfire.org.git/commitdiff
Show SSL protocol (and possibly cipher) in page footer
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 13 Jun 2015 12:45:49 +0000 (14:45 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 13 Jun 2015 12:45:49 +0000 (14:45 +0200)
templates/base.html
webapp/handlers_base.py

index e8fc60562c3c793ab1a0e68fb7290a8e40f5c042..080ba0ca1b6d5b2defbc25d8349c860264d3657a 100644 (file)
 
                                        <p>
                                                &copy; {{ year }} - {{ _("IPFire is free software") }}
+
+                                               {% if ssl_protocol %}
+                                                       &bull; <span class="fa fa-lock"></span>
+                                                       {{ ssl_protocol }}
+
+                                                       {% if ssl_cipher %}({{ ssl_cipher }}){% end %}
+                                               {% end %}
                                        </p>
                                </div>
                        </footer>
index 765bbef348e7eaf419a7b84e849a11b7bc4153c3..6f1ec9d4cea4cd0c838e4779508a6747b450dde8 100644 (file)
@@ -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