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

Re: http.sslVersion only specifies minimum TLS version, later versions are allowed

From
Jeff King <peff@peff.net>
Date
May 3, 2021, 14:10 UTC
Message-ID
<YJAEVMeY9v/j6PeS@coredump.intra.peff.net>
In-Reply-To
<87pmy7x6le.fsf@evledraar.gmail.com>
On Mon, May 03, 2021 at 03:55:31PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 33 quoted lines
> On Mon, May 03 2021, Daniel Carpenter wrote:
> 
> > When I run: "GIT_SSL_VERSION=tlsv1.2 GIT_CURL_VERBOSE=T git clone https://github.com/git/git.git"
> >
> > I see: "SSL connection using TLS1.3 / ECDHE_RSA_AES_128_GCM_SHA256", but I was expecting to see "TLS1.2".
> >
> > This happens because the "sslversions" array (
> > https://github.com/git/git/blob/7e391989789db82983665667013a46eabc6fc570/http.c#L58
> > ) uses "CURL_SSLVERSION_TLSv1_2" which only specifies TLS 1.2 or later
> > ( https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html ).
> >
> > I think configuring "tlsv1.2" should imply "CURL_SSLVERSION_TLSv1_2 |
> > CURL_SSLVERSION_MAX_TLSv1_2", to force that specific version (and the
> > same for "tlsv1.0", "tlsv1.1", "tlsv1.3").
> >
> > For background: I noticed this because of this issue with debian
> > buster https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987188 . The
> > new libcurl backport enables TLS 1.3 support with gnutls, but it
> > doesn't work for certain operations, so buster applications using a
> > backported libcurl need to explicitly disable TLS 1.3 .
> 
> I think you're right per the documentation, but I wonder if the current
> behavior isn't more useful for most users. I.e. are there really users
> who want exactly 1.2 and not 1.3, 1.4 etc. in the future that aren't
> dealing with an issue like what you're encountering?
> 
> I.e. the "better security in the future by default" seems like a
> better/more common case than "pin to this forever" in this case, no?
> 
> We should of course have a way to pin it, but given the current behavior
> I wonder if we shouldn't just change the documentation, and introduce
> support for e.g. "=tlsv1.1" etc, or a http.pinSSLVersion=tls1.1 or
> something...

Just looking at how the curl binary does it, "--tlsv1.2" means "1.2 or greater" (which is not at all surprising; the library interface tends to mirror their command-line and vice versa, and our behavior is influenced by the library interface here). But that implies to me that curl folks considered this and though the "or greater" behavior was useful (which makes sense -- the main goal is probably to avoid insecurities in older versions of the protocol).

Anyway, the binary also has --tls-max for capping the maximum version. That seems more flexible in general than "use this version exactly" (if you only care that 1.3 is broken, then setting "max=1.2" lets you talk to servers that support 1.1 or 1.2).

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Daniel Carpenter
Message 3 of 9 in “http.sslVersion only specifies minimum TLS version, later versions are allowed”
  1. Daniel CarpenterMay 3, 2021
  2. Ævar Arnfjörð BjarmasonMay 3, 2021
  3. Jeff KingMay 3, 2021
  4. Daniel CarpenterMay 3, 2021
  5. Jeff KingMay 3, 2021
  6. Randall S. BeckerMay 3, 2021
  7. Daniel StenbergMay 3, 2021
  8. Randall S. BeckerMay 3, 2021
  9. Daniel StenbergMay 3, 2021

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.