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

[PATCH v5 2/5] http.c: fix parsing of GIT_SSL_CERT_PASSWORD_PROTECTED variable

From
Kyle J. McKay <mackyle@gmail.com>
Date
Jul 15, 2013, 09:50 UTC
Message-ID
<41e6c55e7d5ad8bcae6db7d53c846f3@f74d39fa044aa309eaea14b9f57fe79>
In-Reply-To
<506e5f642a838b95e0dd5b1f0fa1cfe@f74d39fa044aa309eaea14b9f57fe79>

The existing code triggers whenever GIT_SSL_CERT_PASSWORD_PROTECTED is defined. Setting GIT_SSL_CERT_PASSWORD_PROTECTED to a false value could not be used to override the http.sslCertPasswordProtected setting once it had been turned on.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
---
 http.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/http.c b/http.c
index e65661e..9542a59 100644
--- a/http.c
+++ b/http.c
@@ -403,11 +403,10 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 		curl_ftp_no_epsv = 1;
 
 	if (url) {
+		int pwdreq = git_env_bool("GIT_SSL_CERT_PASSWORD_PROTECTED", -1);
 		credential_from_url(&http_auth, url);
-		if (!ssl_cert_password_required &&
-		    getenv("GIT_SSL_CERT_PASSWORD_PROTECTED") &&
-		    !prefixcmp(url, "https://"))
-			ssl_cert_password_required = 1;
+		if (pwdreq != -1 && !prefixcmp(url, "https://"))
+			ssl_cert_password_required = pwdreq;
 	}
 
 #ifndef NO_CURL_EASY_DUPHANDLE
-- 
1.8.3
Previous: Kyle J. McKayNext: Kyle J. McKay
Message 3 of 9 in “config: add support for http.<url>.* settings”
  1. 0/5 config: add support for http.<url>.* settingsKyle J. McKay, Jul 15, 2013
  2. 1/5 http.c: fix parsing of http.sslCertPasswordProtected variableKyle J. McKay, Jul 15, 2013
  3. 2/5 http.c: fix parsing of GIT_SSL_CERT_PASSWORD_PROTECTED variableKyle J. McKay, Jul 15, 2013
  4. 3/5 config: add support for http.<url>.* settingsKyle J. McKay, Jul 15, 2013
  5. 4/5 config: improve support for http.<url>.* settingsKyle J. McKay, Jul 15, 2013
  6. Eric SunshineJul 15, 2013
  7. Kyle J. McKayJul 16, 2013
  8. Eric SunshineJul 16, 2013
  9. 5/5 tests: add new test for the url_normalize functionKyle J. McKay, Jul 15, 2013

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.