Fix certificate loading

Ignore garbage produced when converting certificates with openssl.
This commit is contained in:
Škof, Aljaž 2025-02-26 16:42:47 +01:00 committed by Timotej Lazar
parent cb8bb2531e
commit f99891ad4a

View file

@ -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: