Re: [PATCH 1/2] http: add client cert for HTTPS proxies.
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 21, 2020, 22:28 UTC
- Message-ID
- <CAPig+cRYCC9MvAgVecEuvK1wqvWpVWS0ipmKPMKSctFbjHThvQ@mail.gmail.com>
- In-Reply-To
- <3cf866d0384a0743e6625dd4e5124f00a5db5e7d.1582321003.git.gitgitgadget@gmail.com>
On Fri, Feb 21, 2020 at 4:37 PM Jorge Lopez Silva via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 29 quoted lines
> Git currently supports performing connections to HTTPS proxies but we
> don't support doing mutual authentication with them (through TLS). This
> commit adds the necessary options to be able to send a client
> certificate to the HTTPS proxy.
> [...]
> Signed-off-by: Jorge Lopez Silva <jalopezsilva@gmail.com>
> ---
> diff --git a/http.c b/http.c
> @@ -1018,9 +1046,23 @@ static CURL *get_curl_handle(void)
> #if LIBCURL_VERSION_NUM >= 0x073400
> - else if (starts_with(curl_http_proxy, "https"))
> + else if (starts_with(curl_http_proxy, "https")) {
> curl_easy_setopt(result,
> CURLOPT_PROXYTYPE, CURLPROXY_HTTPS);
> +
> + if (http_proxy_ssl_cert != NULL) {
> + curl_easy_setopt(result,
> + CURLOPT_PROXY_SSLCERT, http_proxy_ssl_cert);
> + }
> + if (http_proxy_ssl_key != NULL) {
> + curl_easy_setopt(result,
> + CURLOPT_PROXY_SSLKEY, http_proxy_ssl_key);
> + }
> + if (http_proxy_ssl_key_passwd != NULL) {
> + curl_easy_setopt(result,
> + CURLOPT_PROXY_KEYPASSWD, http_proxy_ssl_key_passwd);
> + }
> + }
> #endifAll the closing braces in this hunk seem to be over-indented. Also, all of the braces for the one-liner 'if' bodies can be dropped, thus making it less noisy.