uacme: wildcard-only domain breaks certificate path handling in hook.sh
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 77/100
Direzione di ricerca
Inizia da net/uacme/files/hook.sh e /etc/init.d/acme, seguendo le righe individuate nel report relative alla costruzione dei percorsi e allo spostamento nell’area di staging. Controlla come uacme memorizza i certificati wildcard, quindi individua quali valori vengono usati per i percorsi del filesystem e quali vengono passati per l’emissione. Il lavoro è completato quando i certificati solo wildcard vengono installati e rinnovati senza percorsi errati, mentre il comportamento dei certificati non wildcard rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
With a wildcard-only certificate section such as:
config cert 'wildcard'
option enabled '1'
option validation_method 'dns'
option key_type 'ec256'
list domains '*.example.com'
/etc/init.d/acme sets main_domain='*.example.com', and /usr/lib/acme/hook (from net/uacme/files/hook.sh) uses main_domain verbatim for filesystem paths:
domain_dir="$state_dir/$main_domain"(hook.sh lines 91 and 96)$state_dir/private/$main_domain/key.pem(line 22, 32)$CERT_DIR/$main_domain.{crt,key,fullchain.crt,combined.crt,chain.crt}(lines 27-41)link_certs()writescombined.cer,leaf_cert.pem,chain.crtinto"$domain_dir"(lines 22-24)
uacme itself sanitizes the wildcard for storage and writes to $state_dir/example.com/ and $state_dir/private/example.com/. As a result the certificate is issued correctly but post-processing fails:
daemon.err hook[xxxx]: /usr/lib/acme/hook: line 22: can't create /etc/acme/*.example.com/combined.cer: nonexistent directory
daemon.err hook[xxxx]: /usr/lib/acme/hook: line 23: can't create /etc/acme/*.example.com/leaf_cert.pem: nonexistent directory
daemon.err hook[xxxx]: /usr/lib/acme/hook: line 24: can't create /etc/acme/*.example.com/chain.crt: nonexistent directory
Broken symlinks with a literal * in the name are also created under /etc/ssl/acme/:
/etc/ssl/acme/*.example.com.chain.crt -> /etc/acme/*.example.com/chain.crt
/etc/ssl/acme/*.example.com.combined.crt -> /etc/acme/*.example.com/combined.cer
/etc/ssl/acme/*.example.com.crt -> /etc/acme/*.example.com/leaf_cert.pem
/etc/ssl/acme/*.example.com.fullchain.crt -> /etc/acme/*.example.com/cert.pem
/etc/ssl/acme/*.example.com.key -> /etc/acme/private/*.example.com/key.pem
The ACME issuance itself succeeds, but automatic installation / renewal post-processing does not complete, so consumers (e.g. uhttpd) never get the updated certificate links.
Expected behavior
Paths derived from the domain should be sanitized (strip a leading *.), while the original identifier is still passed to uacme for issuance. For non-wildcard domains the behavior must not change.
Workaround
List the apex first so main_domain contains no *:
list domains 'example.com' '*.example.com'
This avoids the broken paths, but changes the requested SAN set (adds the apex) and should not be required to use a wildcard certificate.
Suggested fix
In /etc/init.d/acme or in hook.sh, derive a sanitized name for path usage, e.g.:
cert_name="${main_domain#\*.}"
and use cert_name for domain_dir, the private key path and the /etc/ssl/acme symlink names, keeping main_domain for ACME arguments, logging and nftables rules. The same cleanup should be applied to the staging-move logic ($state_dir/private/$main_domain.staging, lines 117 and 219).
Environment
- OpenWrt 25.12.6 (r33311-981c978eff), mediatek/filogic, aarch64_cortex-a53
- uacme 1.8.1-r4
/etc/ssl/acmeasCERT_DIR, defaultstate_dir=/etc/acme- Reproduced with both a wildcard-only section and, previously, a staging certificate for the same name
Duplicate check
Searched openwrt/packages for uacme wildcard, hook.sh uacme: no matching report found.
- Lingua principale
- Makefile
- Stelle
- 4.7k
- Fork
- 4k
- Merge medio
- 2g 12h
- PR unite (30g)
- 287
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openwrt/packages
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
ser2net: support 'host' option in ser2net_proxy() to allow binding to a specific IP (e.g. 127.0.0.1)Apertabug release/25.12
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
vnstat2: missing keep.d-fileApertabug release/25.12
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openwrt/packages#31310 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
rsyslog: missing keep.d-fileApertabug release/25.12
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openwrt/packages#31309 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug release/25.12
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
openwrt/packages#31308 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openwrt/packages
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
karmada-io/karmada#8101 ·
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100