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

[PATCH] Fix https interactive authentication problem

From
SRSteinmann Ruedi <ruediste@student.ethz.ch>
Date
Nov 23, 2011, 07:58 UTC
Message-ID
<F6A589D6B10801478E0DE246A9EF187C1BD5E8@MBX12.d.ethz.ch>
>From 986e29085ee2215a3e0a412ee7874dc2d0ef36be Mon Sep 17 00:00:00 2001
From: Ruedi Steinmann <ruediste@student.ethz.ch>
Date: Wed, 23 Nov 2011 08:41:52 +0100
Subject: [PATCH] Fix https interactive authentication problem

Cloning a repository over https works fine when the username/password is given in the URL. But if it is queried interactively, an error occurs(see below). I found that the username/password is not set when a connection is reused.

With this patch, the username/password is set whenever a connection is reused.
Sample output showing the error:

git clone https://n.ethz.ch/student/... Cloning into ... Username: Password: error: Unable to get pack file https://n.ethz.ch/student/.../objects/pack/pack-1ced2ebff0c9fc1f07e0c7cc9dd3fc75f6ac6962.pack The requested URL returned error: 401 ... error: Fetch failed.

Signed-off-by: Ruedi Steinmann <ruediste@student.ethz.ch>
---
 http.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/http.c b/http.c
index e6c7597..c7b3558 100644
--- a/http.c
+++ b/http.c
@@ -550,7 +550,10 @@ struct active_request_slot *get_active_slot(void)
     curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL);
     curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
     curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
-
+
+    // set username and password if already set
+    init_curl_http_auth(slot->curl);
+
     return slot;
 }

--
1.7.5.4
Next: Jeff King
Message 1 of 3 in “Fix https interactive authentication problem”
  1. Fix https interactive authentication problemSteinmann Ruedi, Nov 23, 2011
  2. Jeff KingNov 23, 2011
  3. Ruedi SteinmannNov 25, 2011

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.