Skip to content

Commit 48ef536

Browse files
committed
Configure git to use the certificate, if needed
1 parent 1167400 commit 48ef536

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

go/extractor/util/registryproxy.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ func getEnvVars() []string {
122122

123123
if len(git_sources) > 0 {
124124
goprivate = append(goprivate, git_sources...)
125+
126+
if proxy_cert_file != "" {
127+
cmd := exec.Command("git", "config", "--global", "http.sslCAInfo", proxy_cert_file)
128+
129+
out, cmdErr := cmd.CombinedOutput()
130+
slog.Info(string(out))
131+
132+
if cmdErr != nil {
133+
slog.Error("Failed to configure `git` to accept the certificate file", slog.String("error", cmdErr.Error()))
134+
}
135+
}
125136
}
126137

127138
result = append(result, fmt.Sprintf("GOPRIVATE=%s", strings.Join(goprivate, ",")))

0 commit comments

Comments
 (0)