From ce709c3b6f029a5486789b3772cf1d47a315eee2 Mon Sep 17 00:00:00 2001 From: meow Date: Wed, 19 Feb 2020 14:44:19 +0500 Subject: [PATCH] Add certificates option for etcd --- config.py | 8 ++++++-- sample-pay.conf | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 4d5e16a..4e000c9 100644 --- a/config.py +++ b/config.py @@ -7,7 +7,7 @@ from ldap_manager import LdapManager config_file = os.environ.get('meow-pay-config-file', default='pay.conf') -config = configparser.ConfigParser() +config = configparser.ConfigParser(allow_no_value=True) try: successfully_read_files = config.read(config_file) @@ -18,7 +18,11 @@ if not successfully_read_files: sys.exit(f'Config file {config_file} couldn\'t be read.') try: - etcd_client = EtcdWrapper(host=config.get('etcd', 'host'), port=config.get('etcd', 'port')) + etcd_client = EtcdWrapper( + host=config.get('etcd', 'host'), port=config.get('etcd', 'port'), + ca_cert=config.get('etcd', 'ca_cert'), cert_key=config.get('etcd', 'cert_key'), + cert_cert=config.get('etcd', 'cert_cert') + ) ldap_manager = LdapManager( server=config.get('ldap', 'server'), admin_dn=config.get('ldap', 'admin_dn'), diff --git a/sample-pay.conf b/sample-pay.conf index 7138838..5d1fe61 100644 --- a/sample-pay.conf +++ b/sample-pay.conf @@ -1,6 +1,9 @@ [etcd] host = 127.0.0.1 port = 2379 +ca_cert +cert_cert +cert_key [stripe] private_key=stripe_private_key