git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http: support CURLPROXY_HTTPS

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2017, 21:38 UTC
Message-ID
<xmqq7etiv1n5.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171219205807.GC240141@aiede.mtv.corp.google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 16 quoted lines
> Hi,
>
> Wei Shuyu wrote:
>
>> HTTP proxy over SSL is supported by curl since 7.52.0.
>> This is very useful for networks with protocol whitelist.
>>
>> Signed-off-by: Wei Shuyu <wsy@dogben.com>
>> ---
>>  http.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>
> Thanks for writing this.  Can you give an example of how I'd use it
> (ideally in the form of a test in t/ so we avoid this functionality
> regressing, but if that's not straightforward then an example for the
> commit message is fine as well)?

Just FYI, here is an entry I added to the What's cooking report (which will be used as the log message for a merge commit that pulls this topic in, and will become an entry in the release notes if this topic ever becomes a part of a release).

 Git has been taught to support an https:// used for http.proxy when
 using recent versions of libcurl.

There are multiple ways other than http.proxy configuration variable that a user can use to tell Git to use a proxy; I do not think the log message of this change is a place to enumerate all of them, but showing one of them to the readers would be good to remind them what we are talking about, I would guess.

Show 14 quoted lines
>> diff --git a/http.c b/http.c
>> index 215bebef1..32d33261c 100644
>> --- a/http.c
>> +++ b/http.c
>> @@ -865,6 +865,11 @@ static CURL *get_curl_handle(void)
>>  		else if (starts_with(curl_http_proxy, "socks"))
>>  			curl_easy_setopt(result,
>>  				CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
>> +#endif
>> +#if LIBCURL_VERSION_NUM >= 0x073400
>
> Can this use #ifdef CURLPROXY_HTTPS instead?  That way, if someone's
> copy of curl has backported support then they get the benefit of this
> change as well.

It sounds like a worthwhile thing to do (assuming that these are always implemented as preprocessor macros).

Show 9 quoted lines
>> +		else if (starts_with(curl_http_proxy, "https"))
>> +			curl_easy_setopt(result,
>> +				CURLOPT_PROXYTYPE, CURLPROXY_HTTPS);
>>  #endif
>>  		if (strstr(curl_http_proxy, "://"))
>>  			credential_from_url(&proxy_auth, curl_http_proxy);
>
> Thanks and hope that helps,
> Jonathan
Previous: Jonathan NiederNext: Jonathan Nieder
Message 3 of 6 in “http: support CURLPROXY_HTTPS”
  1. http: support CURLPROXY_HTTPSWei Shuyu, Dec 19, 2017
  2. Jonathan NiederDec 19, 2017
  3. Junio C HamanoDec 19, 2017
  4. Jonathan NiederDec 19, 2017
  5. Wei ShuyuDec 20, 2017
  6. Jeff KingDec 20, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.