From 41ee30246328d8601fa125759971816e619528b6 Mon Sep 17 00:00:00 2001 From: ale Date: Fri, 14 Jul 2017 20:17:19 +0000 Subject: [PATCH] Add a simple WSGI app wrapper --- autoca/wsgiapp.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 autoca/wsgiapp.py diff --git a/autoca/wsgiapp.py b/autoca/wsgiapp.py new file mode 100644 index 0000000..8094586 --- /dev/null +++ b/autoca/wsgiapp.py @@ -0,0 +1,20 @@ +import os +from autoca import ca +from autoca import ca_app +from autoca import certutil + + +def create_app(): + config = { + 'CERTIFICATE_BITS': 2048, + 'DATA_DIR': './data', + 'CA_SUBJECT': 'ou=CA', + 'CA_DIGEST': 'sha256', + } + # APP_CONFIG *must* be defined. + execfile(os.getenv('APP_CONFIG'), {}, config) + ca_instance = ca.CA(config['DATA_DIR'], + certutil.parse_subject(config['CA_SUBJECT']), + config['CERTIFICATE_BITS']) + return make_app(ca_instance) + -- GitLab