fix: Disable keep-alive for HTTPS connection to Git (#3531)

This commit is contained in:
jannfis 2020-05-01 19:56:25 +02:00 committed by GitHub
parent 1b0421c3aa
commit 3df4850418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,6 +147,7 @@ func GetRepoHTTPClient(repoURL string, insecure bool, creds Creds) *http.Client
InsecureSkipVerify: true,
GetClientCertificate: clientCertFunc,
},
DisableKeepAlives: true,
}
} else {
parsedURL, err := url.Parse(repoURL)
@ -164,6 +165,7 @@ func GetRepoHTTPClient(repoURL string, insecure bool, creds Creds) *http.Client
RootCAs: certPool,
GetClientCertificate: clientCertFunc,
},
DisableKeepAlives: true,
}
} else {
// else no custom certificate stored.
@ -172,6 +174,7 @@ func GetRepoHTTPClient(repoURL string, insecure bool, creds Creds) *http.Client
TLSClientConfig: &tls.Config{
GetClientCertificate: clientCertFunc,
},
DisableKeepAlives: true,
}
}
}