Skip to content

Commit b2993a7

Browse files
committed
Fix missing TLS ServerName in HelmRepository
Add ServerName configuration to TLS config in HelmRepository client options to ensure proper SNI (Server Name Indication) support for virtual hosting environments. This addresses the regression introduced when migrating from internal/tls to runtime/secrets, where ServerName was not being set automatically. Without ServerName, TLS handshakes fail with certificate mismatch errors when connecting to Helm repositories using virtual hosting where multiple repositories are hosted on the same IP address. Signed-off-by: cappyzawa <[email protected]>
1 parent 74242e5 commit b2993a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/helm/getter/client_opts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func configureAuthentication(ctx context.Context, c client.Client, obj *sourcev1
122122
}
123123
certSecret = secret
124124

125-
tlsConfig, err := secrets.TLSConfigFromSecret(ctx, secret)
125+
tlsConfig, err := secrets.TLSConfigFromSecret(ctx, secret, obj.Spec.URL, obj.Spec.Insecure)
126126
if err != nil {
127127
return false, nil, nil, fmt.Errorf("failed to construct Helm client's TLS config: %w", err)
128128
}
@@ -138,7 +138,7 @@ func configureAuthentication(ctx context.Context, c client.Client, obj *sourcev1
138138
}
139139
authSecret = secret
140140

141-
methods, err := secrets.AuthMethodsFromSecret(ctx, secret)
141+
methods, err := secrets.AuthMethodsFromSecret(ctx, secret, secrets.WithTLS(obj.Spec.URL, obj.Spec.Insecure))
142142
if err != nil {
143143
return false, nil, nil, fmt.Errorf("failed to detect authentication methods: %w", err)
144144
}

0 commit comments

Comments
 (0)