From: Jeff King Date: Tue, 1 Dec 2015 22:21:01 +0000 (-0500) Subject: Merge branch 'cb/ssl-config-pathnames' into maint X-Git-Tag: v2.6.4~14 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/712a12e50612ec594d9cc4235a9e0825a50d3097?hp=-c Merge branch 'cb/ssl-config-pathnames' into maint Allow tilde-expansion in some http config variables. * cb/ssl-config-pathnames: http: treat config options sslCAPath and sslCAInfo as paths --- 712a12e50612ec594d9cc4235a9e0825a50d3097 diff --combined http.c index f0a5c05bc7,0bce727f13..c29ce81ccc --- a/http.c +++ b/http.c @@@ -215,10 -215,10 +215,10 @@@ static int http_options(const char *var #endif #if LIBCURL_VERSION_NUM >= 0x070908 if (!strcmp("http.sslcapath", var)) - return git_config_string(&ssl_capath, var, value); + return git_config_pathname(&ssl_capath, var, value); #endif if (!strcmp("http.sslcainfo", var)) - return git_config_string(&ssl_cainfo, var, value); + return git_config_pathname(&ssl_cainfo, var, value); if (!strcmp("http.sslcertpasswordprotected", var)) { ssl_cert_password_required = git_config_bool(var, value); return 0; @@@ -465,17 -465,6 +465,17 @@@ static CURL *get_curl_handle(void if (curl_http_proxy) { curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy); +#if LIBCURL_VERSION_NUM >= 0x071800 + if (starts_with(curl_http_proxy, "socks5")) + curl_easy_setopt(result, + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); + else if (starts_with(curl_http_proxy, "socks4a")) + curl_easy_setopt(result, + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A); + else if (starts_with(curl_http_proxy, "socks")) + curl_easy_setopt(result, + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); +#endif } #if LIBCURL_VERSION_NUM >= 0x070a07 curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);