Skip to content

Commit 5841520

Browse files
etobisgitster
authored andcommitted
http: always use any proxy auth method available
We set CURLOPT_PROXYAUTH to use the most secure authentication method available only when the user has set configuration variables to specify a proxy. However, libcurl also supports specifying a proxy through environment variables. In that case libcurl defaults to only using the Basic proxy authentication method, because we do not use CURLOPT_PROXYAUTH. Set CURLOPT_PROXYAUTH to always use the most secure authentication method available, even when there is no git configuration telling us to use a proxy. This allows the user to use environment variables to configure a proxy that requires an authentication method different from Basic. Signed-off-by: Enrique A. Tobis <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d4a3ff commit 5841520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ static CURL *get_curl_handle(void)
406406

407407
if (curl_http_proxy) {
408408
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
409+
}
409410
#if LIBCURL_VERSION_NUM >= 0x070a07
410-
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
411+
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
411412
#endif
412-
}
413413

414414
set_curl_keepalive(result);
415415

0 commit comments

Comments
 (0)