PageRenderTime 4ms CodeModel.GetById 0ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/web/ssl-forward-cert.py

https://bitbucket.org/prologic/circuits/
Python | 21 lines | 12 code | 7 blank | 2 comment | 0 complexity | 972e48add4bfae8f51ae29d27787f934 MD5 | raw file
 1#!/usr/bin/env python
 2
 3# stdlib
 4import ssl
 5
 6from circuits.web import Server, Controller
 7
 8
 9class Root(Controller):
10
11    def GET(self, peer_cert=None):
12        return "Here's your cert %s" % peer_cert
13
14
15app = Server(
16    ("0.0.0.0", 8443),
17    ssl=True, certfile="server-cert.pem", keyfile="server-key.pem",
18    ca_certs="ca-chain.pem", cert_reqs=ssl.CERT_OPTIONAL
19)
20Root().register(app)
21app.run()