Add certificates option for etcd

This commit is contained in:
ahmadbilalkhalid 2020-02-19 14:44:19 +05:00
parent 519279ce6f
commit ce709c3b6f
2 changed files with 9 additions and 2 deletions

View file

@ -7,7 +7,7 @@ from ldap_manager import LdapManager
config_file = os.environ.get('meow-pay-config-file', default='pay.conf') config_file = os.environ.get('meow-pay-config-file', default='pay.conf')
config = configparser.ConfigParser() config = configparser.ConfigParser(allow_no_value=True)
try: try:
successfully_read_files = config.read(config_file) 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.') sys.exit(f'Config file {config_file} couldn\'t be read.')
try: 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( ldap_manager = LdapManager(
server=config.get('ldap', 'server'), admin_dn=config.get('ldap', 'admin_dn'), server=config.get('ldap', 'server'), admin_dn=config.get('ldap', 'admin_dn'),

View file

@ -1,6 +1,9 @@
[etcd] [etcd]
host = 127.0.0.1 host = 127.0.0.1
port = 2379 port = 2379
ca_cert
cert_cert
cert_key
[stripe] [stripe]
private_key=stripe_private_key private_key=stripe_private_key