Re: [PATCH] http: support CURLPROXY_HTTPS
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 19, 2017, 20:59 UTC
- Message-ID
- <20171219205807.GC240141@aiede.mtv.corp.google.com>
- In-Reply-To
- <20171219172401.5263-1-wsy@dogben.com>
Hi,
Wei Shuyu wrote:
Show 7 quoted lines
> 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)?
Show 10 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.
Show 6 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