plugins icon indicating copy to clipboard operation
plugins copied to clipboard

security/acme-client: Deploy a certificate to proxmox not possible

Open Stephan-4711 opened this issue 3 years ago • 11 comments

Newest acme plugin installed in the newest production release, the deployment of an certificate to proxmox isn't possible. Steps to reproduce Try to deploy a certificate to a proxmox host other services like fritzbox or truenas are running fine

Debug log 2023-10-10T17:47:57 opnsense AcmeClient: running acme.sh deploy hook failed (acme_proxmoxve) 2023-10-10T17:47:57 opnsense AcmeClient: cleared recorded deploy deploy hook from acme.sh (/var/etc/acme-client/home/PVE.mydomain.de/PVE.mydomain.de.conf) 2023-10-10T17:47:55 opnsense AcmeClient: running acme.sh command: /usr/local/sbin/acme.sh --deploy --syslog 7 --debug --server 'letsencrypt' --home '/var/etc/acme-client/home' --certpath '/var/etc/acme-client/certs/certpath/cert.pem' --keypath '/var/etc/acme-client/keys/6certpath/private.key' --capath '/var/etc/acme-client/certs/certpath/chain.pem' --fullchainpath '/var/etc/acme-client/certs/certpath/fullchain.pem' --domain 'PVE.mydomain.de' --deploy-hook proxmoxve 2023-10-10T17:47:55 opnsense AcmeClient: running automation (acme.sh): Proxmox cert update 2023-10-10T17:47:54 opnsense AcmeClient: running automations for certificate: PVE.mydomain.de 2023-10-10T17:47:16 opnsense AcmeClient: running acme.sh deploy hook failed (acme_proxmoxve) 2023-10-10T17:47:16 opnsense AcmeClient: cleared recorded deploy deploy hook from acme.sh (/var/etc/acme-client/home/PVE.mydomain.de/PVE.mydomain.de.conf) 2023-10-10T17:47:14 opnsense AcmeClient: running acme.sh command: /usr/local/sbin/acme.sh --deploy --syslog 7 --debug --server 'letsencrypt' --home '/var/etc/acme-client/home' --certpath '/var/etc/acme-client/certs/certpath/cert.pem' --keypath '/var/etc/acme-client/keys/certpath/private.key' --capath '/var/etc/acme-client/certs/certpath/chain.pem' --fullchainpath '/var/etc/acme-client/certs/certpath/fullchain.pem' --domain 'PVE.mydomain.de' --deploy-hook proxmoxve 2023-10-10T17:47:14 opnsense AcmeClient: running automation (acme.sh): Proxmox cert update 2023-10-10T17:47:13 opnsense AcmeClient: running automations for certificate: PVE.mydomain.de 2023-10-10T17:49:16 acme.sh [Tue Oct 10 17:49:16 CEST 2023] _CURL='curl --silent --dump-header /var/etc/acme-client/home/http.header -L -g --connect-timeout 10' 2023-10-10T17:49:16 acme.sh [Tue Oct 10 17:49:16 CEST 2023] timeout=10 2023-10-10T17:49:16 acme.sh [Tue Oct 10 17:49:16 CEST 2023] url='https://dns.google/' 2023-10-10T17:49:16 acme.sh [Tue Oct 10 17:49:16 CEST 2023] GET 2023-10-10T17:49:16 acme.sh [Tue Oct 10 17:49:16 CEST 2023] ret='28' 2023-10-10T17:49:16 acme.sh [Tue Oct 10 17:49:15 CEST 2023] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 28 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] _CURL='curl --silent --dump-header /var/etc/acme-client/home/http.header -L -g --connect-timeout 10' 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] timeout=10 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] url='https://cloudflare-dns.com/' 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] GET 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] Detect dns server first. 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] No doh 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] ret='28' 2023-10-10T17:49:05 acme.sh [Tue Oct 10 17:49:05 CEST 2023] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 28

Stephan-4711 avatar Oct 10 '23 16:10 Stephan-4711

Thank you for creating an issue. Since the ticket doesn't seem to be using one of our templates, we're marking this issue as low priority until further notice.

For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.

The easiest option to gain traction is to close this ticket and open a new one using one of our templates.

OPNsense-bot avatar Oct 10 '23 17:10 OPNsense-bot

It's using the proxmox template!

Stephan-4711 avatar Oct 10 '23 17:10 Stephan-4711

It's using the proxmox template!

The bot is complaining about the issue in "this" case, not what you are using inside the product....

JSuenram avatar Oct 13 '23 18:10 JSuenram

Unfortunately there are log entries missing. Please try again and provide the full "ACME Log".

fraenki avatar Oct 17 '23 08:10 fraenki

same problem here.

puerto-rico avatar Nov 11 '23 00:11 puerto-rico

Got the same problem...

rantwolf avatar Nov 24 '23 20:11 rantwolf

Please try again and provide the full "ACME Log".

fraenki avatar Nov 24 '23 21:11 fraenki

I'm having the same problem, can you advise how I go about providing the full ACME log? The actual "deploy to Proxmox" automation gives this in the ACME log (I've removed parts where it seems to be binary dumps of the contents of the certificate with ***):

2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] Deploy error.
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] Error deploy for domain:mydomain.org
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] _ret='60'
 	 	0180:
***
 	 	<= Recv SSL data, 1279 bytes (0x4ff)
 	 	== Info: TLSv1.3 (IN), TLS handshake, Certificate (11):
 	 	0000: .
 	 	<= Recv SSL data, 1 bytes (0x1)
 	 	0000: .....
 	 	<= Recv SSL data, 5 bytes (0x5)
 	 	0000: ......
 	 	<= Recv SSL data, 6 bytes (0x6)
 	 	== Info: TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
 	 	0000: .
 	 	<= Recv SSL data, 1 bytes (0x1)
 	 	0000: .....
 	 	<= Recv SSL data, 5 bytes (0x5)
 	 	0000: .....
 	 	<= Recv SSL data, 5 bytes (0x5)
***
 	 	<= Recv SSL data, 122 bytes (0x7a)
 	 	== Info: TLSv1.3 (IN), TLS handshake, Server hello (2):
 	 	0000: ....z
 	 	<= Recv SSL data, 5 bytes (0x5)
 	 	== Info: CApath: none
 	 	== Info: CAfile: /usr/local/etc/ssl/cert.pem
***
 	 	=> Send SSL data, 512 bytes (0x200)
 	 	== Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
 	 	0000: .....
 	 	=> Send SSL data, 5 bytes (0x5)
 	 	== Info: ALPN: curl offers h2,http/1.1
 	 	== Info: Connected to 10.0.0.2 (10.0.0.2) port 8006
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] == Info: Trying 10.0.0.2:8006...
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] Here is the curl dump log:
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] _CURL='curl --silent --dump-header /var/etc/acme-client/home/http.header -L --trace-ascii /tmp/tmp.RwWy1Qsr -g '
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] _post_url='https://10.0.0.2:8006/api2/json/nodes/OPNsense/certificates/custom'
2023-12-26T16:26:47-05:00	acme.sh	[Tue Dec 26 16:26:47 EST 2023] POST
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] TARGET_URL='https://10.0.0.2:8006/api2/json/nodes/OPNsense/certificates/custom'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] _cfullchain='/var/etc/acme-client/home/mydomain.org/fullchain.cer'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] _cca='/var/etc/acme-client/home/mydomain.org/ca.cer'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] _ccert='/var/etc/acme-client/home/mydomain.org/mydomain.org.cer'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] _cdomain='mydomain.org'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] _deployApi='/usr/local/share/examples/acme.sh/deploy/proxmoxve.sh'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] DOMAIN_PATH='/var/etc/acme-client/home/mydomain.org'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] Using config home:/var/etc/acme-client/home
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] Running cmd: deploy
2023-12-26T16:26:46-05:00	acme.sh	[Tue Dec 26 16:26:46 EST 2023] Using server: https://acme-v02.api.letsencrypt.org/directory

@fraenki

elylv avatar Dec 26 '23 21:12 elylv

It looks like this is a bug in the acme.sh deploy hook, which was fixed upstream just recently: https://github.com/acmesh-official/acme.sh/pull/4853

When a new release of acme.sh is available, this fix will automatically become available in the following release of OPNsense.

fraenki avatar Dec 30 '23 16:12 fraenki

Hi, sorry to revive a 9 month old thread, but are there any solutions to get this working without having to wait for a new acme.sh release?

NanoTrasen-Inc avatar Sep 10 '24 01:09 NanoTrasen-Inc

@NanoTrasen-Inc You may apply the patch from https://github.com/acmesh-official/acme.sh/pull/4853/files manually on your OPNsense installation. Other than that there's nothing we can do about it. (Please do not manually upgrade acme.sh, this will break your Acme Client in the long run.)

fraenki avatar Sep 10 '24 09:09 fraenki