Fix certificate reading #1

Merged
jetomit merged 2 commits from as76011/marginaltool:fix into master 2025-02-26 15:36:55 +00:00
Showing only changes of commit 25c047af28 - Show all commits

View file

@ -33,7 +33,8 @@ 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('-----'))
cert = open(args.certfile).read()
args.cert = ''.join(cert[cert.find('-----BEGIN CERTIFICATE-----' + 27):cert.find('-----END CERTIFICATE-----')])
case 'pkcs11':
if not args.id: