Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bug] hostname mismatch error when using a helm repository URL that redirects to another URL in a cluster behind a proxy using self-signed certs

Aperta
#1,219 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
go, helm, kubernetes

Direzione di ricerca

Inizia in internal/helm/getter/getter.go intorno alla riga 102 e riproduci il caso HelmRepository usando un URL che reindirizza mentre il cluster utilizza una CA proxy. Traccia il modo in cui la configurazione TLS viene riutilizzata per la richiesta reindirizzata; il lavoro è completato quando l’indice del repository reindirizzato può essere recuperato senza una mancata corrispondenza dell’hostname.

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

Descrizione

Describe the Bug

We have a Kubernetes cluster behind a mitmproxy running in transparent mode that uses self-signed certs.
Created a HelmRepository CR of version source.toolkit.fluxcd.io/v1beta2 and a secret to refer to the proxy certificate.

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: bitnamitest
  namespace: default
spec:
  secretRef:
    name: https-ca-credentials
  interval: 10m0s
  provider: generic
  timeout: 60s
  url: https://charts.bitnami.com/bitnami
apiVersion: v1
kind: Secret
metadata:
  name: https-ca-credentials
  namespace: default
type: Opaque
data:
  caFile: <certificate data>

The URL https://charts.bitnami.com/bitnami/index.yaml redirects to https://repo.vmware.com/bitnami-files/index.yaml.
The source controller fails to reconcile the HelmRepository with the error failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://charts.bitnami.com/bitnami/index.yaml : 502 Bad Gateway
On the mitmproxy, we are seeing the error Certificate verify failed: hostname mismatch

When we dug deeper we saw on line(in the latest version of the code) https://github.com/fluxcd/source-controller/blob/af854cfcf92a03986a3acb766dd37f50450d8a6c/internal/helm/getter/getter.go#L102 the tlsConfig.ServerName is populated with the hostname of the helm repo URL. For the redirect request(https://repo.vmware.com) the source controller uses the same tlsConfig with ServerName set to the original repo URL hostname (https://charts.bitnami.com), because of which the hostname mismatch error is happening.

Source Controller Version
1.1.0 (latest)

Lingua principale
Go
Stelle
283
Fork
258
Merge medio
1g 17h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fluxcd/source-controller

Tutte le issue di fluxcd/source-controller

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.