Support default keyfile and certfile in config
This commit is contained in:
parent
14afaaaa18
commit
cb8bb2531e
|
@ -28,9 +28,9 @@ def init(args):
|
||||||
match args.engine:
|
match args.engine:
|
||||||
case 'file':
|
case 'file':
|
||||||
if not args.keyfile:
|
if not args.keyfile:
|
||||||
args.keyfile = config.get(args.url, 'keyfile', fallback=None)
|
args.keyfile = config.get(args.url, 'keyfile')
|
||||||
if not args.certfile:
|
if not args.certfile:
|
||||||
args.certfile = config.get(args.url, 'certfile', fallback=None)
|
args.certfile = config.get(args.url, 'certfile')
|
||||||
if not args.keyfile or not args.certfile:
|
if not args.keyfile or not args.certfile:
|
||||||
raise Exception('key or certificate file not specified')
|
raise Exception('key or certificate file not specified')
|
||||||
args.cert = ''.join(line.strip() for line in open(args.certfile) if not line.startswith('-----'))
|
args.cert = ''.join(line.strip() for line in open(args.certfile) if not line.startswith('-----'))
|
||||||
|
|
Loading…
Reference in a new issue