security/acme-client After restoring a backup configuration to a new install acme can't renew certificates
Describe the bug After restoring a backup configuration to a new install security/acme-client can't renew certificates due to missing file in /var/etc/acme-client/home.
To Reproduce Steps to reproduce the behavior:
- Backup an OPNsense with acme installed and a certificate issued. I use encrypted backups.
- Restore the backup to a new install.
- Attempt to renew the certificate.
- See error.
Expected behavior Acme should be able to complete the renewal.
Relevant log files
[Fri Dec 11 00:00:00 NZDT 2020] | 'ktr.nz' is not an issued domain, skip.
[Fri Dec 11 00:00:00 NZDT 2020] | Renew: 'ktr.nz'
[Fri Dec 11 00:00:00 NZDT 2020] | DOMAIN_PATH='/var/etc/acme-client/home/ktr.nz'
[Fri Dec 11 00:00:00 NZDT 2020] | ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
[Fri Dec 11 00:00:00 NZDT 2020] | default_acme_server
[Fri Dec 11 00:00:00 NZDT 2020] | 'ktr.co.nz' is not an issued domain, skip.
[Fri Dec 11 00:00:00 NZDT 2020] | Renew: 'ktr.co.nz'
[Fri Dec 11 00:00:00 NZDT 2020] | DOMAIN_PATH='/var/etc/acme-client/home/ktr.co.nz'
[Fri Dec 11 00:00:00 NZDT 2020] | ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
[Fri Dec 11 00:00:00 NZDT 2020] | default_acme_server
[Fri Dec 11 00:00:00 NZDT 2020] | '*.home.ktr.nz' is not an issued domain, skip.
[Fri Dec 11 00:00:00 NZDT 2020] | Renew: '*.home.ktr.nz'
[Fri Dec 11 00:00:00 NZDT 2020] | DOMAIN_PATH='/var/etc/acme-client/home/*.home.ktr.nz'
[Fri Dec 11 00:00:00 NZDT 2020] | ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
[Fri Dec 11 00:00:00 NZDT 2020] | default_acme_server
Environment OPNsense 20.7.6-amd64 FreeBSD 12.1-RELEASE-p11-HBSD OpenSSL 1.1.1h 22 Sep 2020 Intel(R) Core(TM) i5-2400 CPU Network Quad port Intel I350
That's the expected behaviour, because we don't backup acme.sh's working directory.
The recovery procedure is outlined here: https://github.com/opnsense/plugins/issues/243#issuecomment-458912014
Quick summary: go to Services: Let's Encrypt: Settings and click the Reset acme client button.