Fix certificate loading
Ignore garbage produced when converting certificates with openssl.
This commit is contained in:
parent
cb8bb2531e
commit
f99891ad4a
|
@ -33,7 +33,9 @@ def init(args):
|
|||
args.certfile = config.get(args.url, 'certfile')
|
||||
if not args.keyfile or not args.certfile:
|
||||
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(
|
||||
cert.split('-----BEGIN CERTIFICATE-----', 1)[1]
|
||||
.split('-----END CERTIFICATE-----', 1)[0])
|
||||
|
||||
case 'pkcs11':
|
||||
if not args.id:
|
||||
|
|
Loading…
Reference in a new issue