apache / apache/cloudstack

Error tying to register ISO/Template with DirectDownload over HTTPS with Let's Encrypt

Aperta
#12,878 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
component:kvm component:templates no-issue-activity
Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
6g 19h
PR unite (30g)
32

Descrizione

### problem

When using the "Direct Download" feature for an ISO or Template (bypassing Secondary Storage), the Agent fails to verify Let's Encrypt certificates due to the absence of Let's Encrypt’s main CA certificate.

> Note: Let's Encrypt is widely used on the internet (>50% of all certificates).

ACS currently loads and trusts certificates exclusively from `/etc/cloudstack/agent/cloud.jks` and does not fall back to Java (`/usr/lib/jvm/java-17-openjdk-amd64/lib/security/cacerts`) or the system store (`/etc/ssl/certs/ca-certificates.crt`). Both of these contain the missing certificate (**ISRG Root X1**), which has been in use since 2015.

See: https://letsencrypt.org/certificates/

Image

**ISRG Root X1** is the current root of the trust chain (valid until 2030), after which it will be replaced by **ISRG Root X2**.

**Recommendation:** Add a fallback to Java’s trust store to avoid maintaining an ever-changing list of certificates.

**Alternative:** As a short-term fix, include the missing CA certificate (https://letsencrypt.org/certs/isrgrootx1.pem) in `/etc/cloudstack/agent/cloud.jks` for the next release, while a more sustainable solution is developed.

### versions

We are running ACS 4.20.2 on Ubuntu 24.04. However, this issue likely affects all versions starting from 4.19, when the feature to bypass Secondary Storage was introduced.

Related issues and PRs:
- https://github.com/apache/cloudstack/issues/7929
- https://github.com/apache/cloudstack/pull/7693/changes
- https://github.com/apache/cloudstack/pull/7923/changes
- https://github.com/apache/cloudstack/pull/7932/changes
- https://github.com/apache/cloudstack/pull/11113/changes

### The steps to reproduce the bug

1. When registering an ISO or Template for Direct Download, use any HTTPS URL whose TLS certificate is issued by Let's Encrypt.

### What to do about it?

As a workaround, the following command can be run for each Zone to add the missing certificate. Note that this introduces additional manual steps for platform maintenance:

```
cmk upload templatedirectdownloadcertificate hypervisor="KVM" name="isrg-root-x1-2" certific
ate="$(curl -s https://letsencrypt.org/certs/isrgrootx1.pem)" zoneid="00000000-0000-0000-00000-000000000000"
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla gestione dei certificati dell'Agent e da `/etc/cloudstack/agent/cloud.jks`, quindi confrontala con `/usr/lib/jvm/java-17-openjdk-amd64/lib/security/cacerts` di Java e con lo store di sistema in `/etc/ssl/certs/ca-certificates.crt`. Riproduci il download diretto di una ISO o di un Template tramite un URL HTTPS usando Let's Encrypt e considera le issue e le PR correlate; il lavoro è completato quando l'Agent verifica il certificato senza un workaround manuale per ogni Zone.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend, cloud, infrastructure
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.