autoca.fcgi 676 Bytes
Newer Older
ale's avatar
ale committed
1 2 3 4 5
#!/usr/bin/python
# A minimal RESTful Certification Authority
# by <ale@incal.net>, 2010

import os
6 7 8
import yaml
from autoca import ca
from autoca import ca_app
ale's avatar
ale committed
9

10
ca_conf_file = os.path.join(os.path.dirname(__file__), 'ca.yml')
ale's avatar
ale committed
11 12


13 14 15
def create_app():
    with open(ca_conf_file, 'r') as fd:
        ca_config = yaml.load(fd)
16
    ca_instance = ca.CA(ca_config['basedir'],
17 18 19 20
                        ca_config['ca_subj'],
                        int(ca_config.get('bits', '4096')),
                        ca_config.get('digest', 'sha1'))
    app = ca_app.make_app(ca_instance)
ale's avatar
ale committed
21 22


23
if __name__ == '__main__':
24 25
    from flup.server.fcgi import WSGIServer
    WSGIServer(create_app()).run()