]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http: accept https:// proxies again
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 27 Jun 2026 17:17:56 +0000 (17:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 28 Jun 2026 15:30:21 +0000 (08:30 -0700)
Since 663d7abe07ea (http: reject unsupported proxy URL schemes,
2026-05-05), set_curl_proxy_type() returns 0 only for the "http"
and SOCKS variants via dedicated early returns, and -1 for
everything else. The "https" branch configures the CURL handle for
HTTPS proxying but then falls through to the trailing `return -1`
intended for unknown schemes, so the caller in get_curl_handle()
treats a perfectly valid https:// proxy URL as unsupported and
refuses to use it.

Noticed while looking into a Coverity report against the same
function; the unchecked curl_easy_setopt() return values it flags
are orthogonal to this fix.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c

diff --git a/http.c b/http.c
index 8e5a4d8bcf8eacb27622ec6ac96ce104e7ccfaf6..8c0f83136589ffb180793efd0ca66e494bd85884 100644 (file)
--- a/http.c
+++ b/http.c
@@ -802,6 +802,8 @@ static int set_curl_proxy_type(CURL *result, const char *protocol)
                if (has_proxy_cert_password())
                        curl_easy_setopt(result, CURLOPT_PROXY_KEYPASSWD,
                                         proxy_cert_auth.password);
+
+               return 0;
        }
 
        return -1;