drGrove / mtls-cli

A short-lived certificate tool based on the Zero Trust network model
Other
27 stars 8 forks source link

current_sha not found and fails on MacOS #28

Closed drGrove closed 4 years ago

drGrove commented 5 years ago
mtls -s <redacted> certificate create
Retrieving CRL from server...
Writing CRL to /Users/<redacted>/.config/mtls/<redacted>/crl.pem
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 788, in get
    value = d[option]
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py", line 914, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py", line 906, in __missing__
    raise KeyError(key)
KeyError: 'current_sha'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/<redacted>/Library/Python/3.7/bin/mtls", line 11, in <module>
    sys.exit(cli())
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/mtls/cli.py", line 183, in create_certificate
    ctx.obj.create_cert(output)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/mtls/mtls.py", line 132, in create_cert
    self.delete_cert_by_name(self.friendly_name)
  File "/Users/<redacted>/Library/Python/3.7/lib/python/site-packages/mtls/mtls.py", line 295, in delete_cert_by_name
    fingerprint = self.config.get(self.server, "current_sha")
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 791, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'current_sha' in section: 'bitgo-test'
drGrove commented 5 years ago

Until this is fixed.

There's a workaround by adding current_sha = "" under the section for the server you're trying to interact with