]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In the test SSL server, also output the cipher name
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 18 Dec 2011 18:00:02 +0000 (19:00 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 18 Dec 2011 18:00:02 +0000 (19:00 +0100)
Lib/test/ssl_servers.py

index 77c05426107b5ddf1ecd26d9306ba830590fd2b3..77be3814e85a804bdd93928e523e912b342e4873 100644 (file)
@@ -94,7 +94,11 @@ class StatsRequestHandler(BaseHTTPRequestHandler):
         """Serve a GET request."""
         sock = self.rfile.raw._sock
         context = sock.context
-        body = pprint.pformat(context.session_stats())
+        stats = {
+            'session_cache': context.session_stats(),
+            'cipher': sock.cipher(),
+            }
+        body = pprint.pformat(stats)
         body = body.encode('utf-8')
         self.send_response(200)
         self.send_header("Content-type", "text/plain; charset=utf-8")