| 705 | } |
| 706 | |
| 707 | static void init_curl_proxy_auth(CURL *result) |
| 708 | { |
| 709 | if (proxy_auth.username) { |
| 710 | if (!proxy_auth.password && !proxy_auth.credential) |
| 711 | credential_fill(the_repository, &proxy_auth, 1); |
| 712 | set_proxyauth_name_password(result); |
| 713 | } |
| 714 | |
| 715 | var_override(&http_proxy_authmethod, getenv("GIT_HTTP_PROXY_AUTHMETHOD")); |
| 716 | |
| 717 | if (http_proxy_authmethod) { |
| 718 | int i; |
| 719 | for (i = 0; i < ARRAY_SIZE(proxy_authmethods); i++) { |
| 720 | if (!strcmp(http_proxy_authmethod, proxy_authmethods[i].name)) { |
| 721 | curl_easy_setopt(result, CURLOPT_PROXYAUTH, |
| 722 | proxy_authmethods[i].curlauth_param); |
| 723 | break; |
| 724 | } |
| 725 | } |
| 726 | if (i == ARRAY_SIZE(proxy_authmethods)) { |
| 727 | warning("unsupported proxy authentication method %s: using anyauth", |
| 728 | http_proxy_authmethod); |
| 729 | curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY); |
| 730 | } |
| 731 | } |
| 732 | else |
| 733 | curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY); |
| 734 | } |
| 735 | |
| 736 | static int has_cert_password(void) |
| 737 | { |
no test coverage detected