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

[PATCH] http: accept https:// proxies again

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 27, 2026, 17:17 UTC
Message-ID
<pull.2161.git.1782580676734.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
    http: accept https:// proxies again
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2161%2Fdscho%2Ffix-bug-in-validate-proxy-url-scheme-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2161/dscho/fix-bug-in-validate-proxy-url-scheme-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2161
 http.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/http.c b/http.c
index 8e5a4d8bcf..8c0f831365 100644
--- 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;

base-commit: 663d7abe07ea376c2657019a03297ae87037c993
-- 
gitgitgadget
Next: Junio C Hamano
Message 1 of 4 in “http: accept https:// proxies again”
  1. http: accept https:// proxies againJohannes Schindelin via GitGitGadget, Jun 27, 2026
  2. Junio C HamanoJun 28, 2026
  3. Junio C HamanoJun 28, 2026
  4. Junio C HamanoJun 28, 2026

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.