polhenarejos / acme_email

ACME Email Client for EmailReply-00 Challenge
https://acme.castle.cloud
GNU General Public License v3.0
59 stars 9 forks source link

Client crash #46

Closed augjoh closed 1 week ago

augjoh commented 3 weeks ago

After installing the following packages with python 3.12.7 on alpine:

Successfully installed ConfigArgParse-1.7 PyOpenSSL-24.2.1 acme-3.0.0 certbot-3.0.0 certbot-castle-0.14.1.dev0 certifi-2024.8.30 charset-normalizer-3.4.0 configobj-5.0.9 distro-1.9.0 dkimpy-1.1.8 dnspython-2.7.0 idna-3.10 imapclient-3.0.1 josepy-1.14.0 parsedatetime-2.6 pyrfc3339-2.0.1 pytz-2024.2 requests-2.32.3 urllib3-2.2.3

Acme client crashes when invoked as follows:

python3 cli.py cert --passphrase passphrase --config-dir . --work-dir . --logs-dir ./logs -e address@mail --contact contact@${HOSTNAME} --imap --host mail --port 3143 --agree-tos --login address@mail --password address@mail --host mail --smtp-port 3025 --smtp-host mail --non-interactive

/builds/platynum/certification-authority/flows/acme_email/certbot_castle/plugins/thunderbird.py:192: SyntaxWarning: invalid escape sequence '\('
  m = re.findall('user_pref\("(.+)",\s*(.+)\)',line)
Saving debug log to /builds/platynum/certification-authority/flows/acme_email/logs/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You are requesting a S/MIME certificate to CASTLE ACME server. Remember to add
the root certificate into your trust store for proper operation.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
An unexpected error occurred:
AttributeError: 'Namespace' object has no attribute 'key_dir'
Ask for help or search for solutions at https://community.letsencrypt.org/. See the logfile /builds/platynum/certification-authority/flows/acme_email/logs/letsencrypt.log or re-run Certbot with -v for more details.
libkoi commented 1 week ago

Confirm the same issue, when trying to issue a cert using IMAP auth method:

DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
  File "/workspace/acme_email/cli.py", line 264, in <module>
    main(args)
  File "/workspace/acme_email/cli.py", line 202, in main
    request_cert(args, config)
  File "/workspace/acme_email/cli.py", line 61, in request_cert
    key, csr = csr_util.prepare(args.email, config, key_path=args.key_path, usage=args.usage)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/acme_email/certbot_castle/csr.py", line 77, in prepare
    key = key or crypto_util.generate_key(config.rsa_key_size, config.key_dir)
                                                               ^^^^^^^^^^^^^^
  File "/workspace/acme_email/venv/lib/python3.11/site-packages/certbot/configuration.py", line 176, in __getattr__
    value = getattr(self.namespace, name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'key_dir'
ERROR:certbot._internal.log:An unexpected error occurred:
ERROR:certbot._internal.log:AttributeError: 'Namespace' object has no attribute 'key_dir'
polhenarejos commented 1 week ago

It's a problem of certbot's version. They changed something that broke the code.

In the meantime you can use v2:

pip install -U certbot==2.11.0