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

Re: BUG: Value for GIT_SSL_NO_VERIFY has no effect

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 15, 2022, 15:27 UTC
Message-ID
<xmqq8rmkpsit.fsf@gitster.g>
In-Reply-To
<YyMi76Cy7KnfZFU4@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 16 quoted lines
> On 2022-09-15 at 01:46:50, Brijesh Patel wrote:
>> Hi,
>
> Hey,
>
>> It appears that any value assigned to GIT_SSL_NO_VERIFY (true or
>> false) has no effect on the GIT operations. For testing purposes, we
>> have created a host entry for github.com and mapped it to foo.com.
>
> This is definitely true.  There are several Git environment variables
> that act this way, including GIT_CURL_VERBOSE, that check whether the
> environment is present or absent, not whether it's set to a particular
> value.
>
> I believe this behaviour is by design (although other folks are free to
> correct me if they think I'e wrong).

Yeah, a plausible alternative that could have existed is to name the variable GIT_SSL_VERIFY with the boolean (or the usual Boolean + 'auto', even though I do not offhand think of what 'auto' should do), but this variable definitely is designed to be "if set, the feature named by the variable goes in effect, and you unset it to make it ineffective".

I did a quick audit of the environment variables documented in git(1) and it is a bit messy. Many environment variables use git_env_bool() to make themselves a proper Boolean environment variable, but some others that are described to take "1" to "enable" do not honor the usual "yes/true/on" convention.

SSL_NO_VERIFY is worse, as it is not even described. So we should add it to "git help git".

 Documentation/git.txt | 5 +++++
 1 file changed, 5 insertions(+)
diff --git c/Documentation/git.txt i/Documentation/git.txt
index 0ef7f5e4ec..1b7e37e79a 100644
--- c/Documentation/git.txt
+++ i/Documentation/git.txt
@@ -682,6 +682,11 @@ for further details.
 	plink or tortoiseplink. This variable overrides the config setting
 	`ssh.variant` that serves the same purpose.
 
+`GIT_SSL_NO_VERIFY`::
+	Setting and exporting this environment variable to any value
+	tells Git not to verify the SSL certificate when fetching or
+	pushing over HTTPS.
+
 `GIT_ASKPASS`::
 	If this environment variable is set, then Git commands which need to
 	acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)
Previous: brian m. carlsonNext: Junio C Hamano
Message 3 of 19 in “BUG: Value for GIT_SSL_NO_VERIFY has no effect”
  1. Brijesh PatelSep 15, 2022
  2. brian m. carlsonSep 15, 2022
  3. Junio C HamanoSep 15, 2022
  4. 0/5 Update docs on GIT_* environment variablesJunio C Hamano, Sep 15, 2022
  5. 2/5 environ: explain Boolean environment variablesJunio C Hamano, Sep 15, 2022
  6. 5/5 environ: GIT_INDEX_VERSION affects not just a new repositoryJunio C Hamano, Sep 15, 2022
  7. 1/5 environ: document GIT_SSL_NO_VERIFYJunio C Hamano, Sep 15, 2022
  8. 3/5 environ: GIT_FLUSH should be made a usual BooleanJunio C Hamano, Sep 15, 2022
  9. René ScharfeJan 3, 2023
  10. Junio C HamanoJan 4, 2023
  11. René ScharfeJan 4, 2023
  12. Jeff KingJan 4, 2023
  13. René ScharfeJan 4, 2023
  14. Jeff KingJan 6, 2023
  15. 4/5 environ: simplify description of GIT_INDEX_FILEJunio C Hamano, Sep 15, 2022
  16. Todd ZullingerSep 16, 2022
  17. Junio C HamanoSep 16, 2022
  18. brian m. carlsonSep 15, 2022
  19. Junio C HamanoSep 15, 2022

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.