Skip to content

Commit 040335a

Browse files
committed
Drop http scheme from CA-bundle guard in gitDownload
InstallProtocol("https", ...) has no effect on plain http:// URLs, so including u.Scheme == "http" in the condition only needlessly locked the mutex and performed a no-op protocol registration.
1 parent ad49f1a commit 040335a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/bundlereader/gitclone.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func gitDownload(ctx context.Context, dst, rawURL string, auth Auth) error {
5454
// When a CA bundle is supplied for an HTTPS URL, install a custom transport
5555
// that trusts only that CA (not the system pool). Serialise with a mutex
5656
// because go-git's protocol registry is process-global.
57-
if len(auth.CABundle) > 0 && (u.Scheme == "https" || u.Scheme == "http") {
57+
// Plain HTTP does not use TLS, so a CA bundle has no effect there.
58+
if len(auth.CABundle) > 0 && u.Scheme == "https" {
5859
caCloneMutex.Lock()
5960
defer caCloneMutex.Unlock()
6061

0 commit comments

Comments
 (0)