Skip to content

uacme: use acme-common and make it able to use acme.sh dns apis#27831

Open
orangepizza wants to merge 7 commits intoopenwrt:masterfrom
orangepizza:uacmeref
Open

uacme: use acme-common and make it able to use acme.sh dns apis#27831
orangepizza wants to merge 7 commits intoopenwrt:masterfrom
orangepizza:uacmeref

Conversation

@orangepizza
Copy link
Contributor

@orangepizza orangepizza commented Nov 11, 2025

📦 Package Details

Maintainer: @lucize

Description:

  • remake uacme hook based on acme-common's call structure, and allow acme virtual package can satisfied by uacme so it can be used with luci-app-acme. and I scrapped functions that used by acme.sh dnsapis and striped it's implementations into separate shell script, dnsapihelper.shand linked into dns challenge hook, so uacme can use dns api from acme.sh without any modification from api side: they want curl or wget, and as uacme already depends on libcurl so I set curl as dependency so I changed dependency to acme-common +acme-acmesh-dnsapi if uacme is selected. while I copied most of acme.sh functions relevant form acme.sh, some if it's function is depend on OpenSSL. while re implemented some in ucode, some crypto functions like sign() and isecc etc will only work when you have OpenSSL, but as only about 10% of 304 scripts calls that I hope one can user themselves can install openssl if needed by their API.
  • while this does call ualpn server if config file is set to, it's user's duty to set ualpn server as needed as same as old version does. Not sure if it's safe to do this automatically because it'd need shutdown uhttpd to allow ualpn to listen port 443. original, same reason it doesn't support standalone validation, because uacme doesn't come with to do that.

🧪 Run Testing Details

  • OpenWrt Version: snapshot
  • OpenWrt Target/Subtarget: x86_64, but only things it touched is shell scripts so shouldn't matter
  • OpenWrt Device: a kvm virtual machine

tested it can issue and renew certificate with uacme as backed, with config set from uacme without Openssl installed with duckdns /cloudflare/ webroot. (acme-common handles opening port when needed if I read code currectly)

due to upstream bug in uacme, this well log a line of error in for not parsing ari info, but it's already fixed in their master branch and just waiting a new release for them.
and uacme never rotate key by itself, until not-released yet version in master branch.


✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@mundschenk-at
Copy link

It looks like this reworking of the scripts drops both the support for custom CA URLs and the TLS-ALPN-01 challenge. I assume this is not intentional?

@orangepizza
Copy link
Contributor Author

orangepizza commented Nov 11, 2025

It does keep custom ca url (I tested on pebble entire time. See line 45 onword from hook.sh

Tls-alpn-01 was never fully done (ulpn.sh was called bit never prepared to run its deamon)

@mundschenk-at
Copy link

It does keep custom ca url (I tested on pebble entire time. See line 45 onword from hook.sh

So what's the config key for that, acme_server (I've got no knowledge of acme-acmesh and the wiki at was silent on that at least in early 2024)? uacme uses acme_url (and acme_url_staging) since #23097. I'm not opposed to unifying that, but it needs documentation and/or a migration script.

Tls-alpn-01 was never fully done (ulpn.sh was called bit never prepared to run its deamon)

It was implemented for uacme in #23097 (with manual ualpn setup as described in the PR).

@orangepizza
Copy link
Contributor Author

I assumed acmesh and uacme hook wouldn't diverged so just took scripts for acme-common from acme-acmesh and fit uacme command line options as that was what need for luci app acme

@mundschenk-at
Copy link

Yeah, that's why I'm speaking up (it was a happy accident that I saw your PR, as this was my first and so far only code contribution to a package and I don't often visit this repo). Let's see how @lucize wants to resolve the URL issue.

@orangepizza
Copy link
Contributor Author

made a migration script, I migrated acme_uri to acme server but removed acme_uri_staging because there's no ui way to see that, and acme.sh hook sets to acme_server even if --staging is set. and I noticed bug in my hook about renewal in process (acme.sh marks staging cert as but we can't set custom server and staging at same time) so fixed it to

@lucize
Copy link
Contributor

lucize commented Nov 12, 2025

I gave up with using the common package because at that time uacme didn't support all ssl packages that acme supported without adding additional ssl library and all was about smaller packages, you have to bear in mind that, by default both acme and uacme will be built by buildbot

@orangepizza
Copy link
Contributor Author

orangepizza commented Nov 12, 2025

as openwrt now moved back to mbedtls by default and it's supported by uacme (and openssl too) I think it can surely save space in most configuration, so I think it worth the effect. (does anything use wolfssl in openwrt context?)
some api like oracle, yandex, TransIP.nl (just those 4 out of 300ish apis) still need openssl for _sign function
but did most other functions in shell script or ucode

Comment on lines 60 to +61
This package provides DNS API integration for ACME (Letsencrypt) client.
scripts are from acme.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second line in the description does not conform to English grammar and isn't descriptive enough IMHO. Do you need any help redoing the description for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to note that those functions are from acme.sh, as this PR make it can linked by other acme client too. But now not sure if it needed as it's name is acme-acmesh-dnsapi already:
Maby it'd better another package that links to this because uacmes dnsapi adapter got quite big (~30kb)

@orangepizza
Copy link
Contributor Author

uacme upstream updated 1.8.0 with bugfix about musl (which openwrt uses)

@lucize
Copy link
Contributor

lucize commented Feb 16, 2026

thanks
can't test the dns api, otherwise LGTM

@orangepizza
Copy link
Contributor Author

@lucize if you don't mind I want to add support for dns-perssis-01 challenge: as it most likely solve need of open port 80/443 or give full dns api key on router to run certificate renewal
https://letsencrypt.org/2026/02/18/dns-persist-01

@orangepizza orangepizza force-pushed the uacmeref branch 2 times, most recently from b5b6bf4 to ab36a4e Compare February 24, 2026 11:28
currently acme metapackage only able to satisfied with acme-acmesh,
but make is satisfieable by uacme if it's already installed.
still defaults to acme.sh

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
remake uacme hook scripts to base on acme-common,
and implements helper to able to use acme.sh DNS APIs

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
migrate old uacme specific config parameters into acme-common format.

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
when both acme_server and staging is set uacme refuse to run,
so do manual server config and do own staging cert mark

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
moved location of dns api config file for less clutter
on main acme state dir

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
for cleaner dependency tree, and to not use space when not needed.
this will reduce about 30kb when not using dnsapi.

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
@orangepizza orangepizza force-pushed the uacmeref branch 2 times, most recently from 8591c4f to ada57ea Compare February 25, 2026 22:23
update uacme version to 1.8.0 , release upstream 2026/1/25

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants