{"thread":{"id":"55611","subject":"http.sslVersion only specifies minimum TLS version, later versions are allowed","startedAt":"2021-05-03T12:11:39Z","lastAt":"2021-05-03T21:23:56Z","messageCount":9,"participants":["Daniel Carpenter","Ævar Arnfjörð Bjarmason","Jeff King","Randall S. Becker","Daniel Stenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"423483","messageId":"8f664b07d1df45bcb6b3f787f42bd046@ammonit.com","threadId":"55611","inReplyTo":null,"subject":"http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Daniel Carpenter","fromEmail":"dc@ammonit.com","sentAt":"2021-05-03T11:56:32Z","receivedAt":"2021-05-03T12:11:39Z","isPatch":false,"sender":{"key":"dc@ammonit.com","avatar":null},"body":"When I run: \"GIT_SSL_VERSION=tlsv1.2 GIT_CURL_VERBOSE=T git clone https://github.com/git/git.git\"\n\nI see: \"SSL connection using TLS1.3 / ECDHE_RSA_AES_128_GCM_SHA256\", but I was expecting to see \"TLS1.2\".\n\nThis 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 ).\n\nI 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\").\n\nFor 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 .\n"},{"id":"423487","messageId":"87pmy7x6le.fsf@evledraar.gmail.com","threadId":"55611","inReplyTo":"8f664b07d1df45bcb6b3f787f42bd046@ammonit.com","subject":"Re: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-03T13:55:31Z","receivedAt":"2021-05-03T13:58:01Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, May 03 2021, Daniel Carpenter wrote:\n\n> When I run: \"GIT_SSL_VERSION=tlsv1.2 GIT_CURL_VERBOSE=T git clone https://github.com/git/git.git\"\n>\n> I see: \"SSL connection using TLS1.3 / ECDHE_RSA_AES_128_GCM_SHA256\", but I was expecting to see \"TLS1.2\".\n>\n> This happens because the \"sslversions\" array (\n> https://github.com/git/git/blob/7e391989789db82983665667013a46eabc6fc570/http.c#L58\n> ) uses \"CURL_SSLVERSION_TLSv1_2\" which only specifies TLS 1.2 or later\n> ( https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html ).\n>\n> I think configuring \"tlsv1.2\" should imply \"CURL_SSLVERSION_TLSv1_2 |\n> CURL_SSLVERSION_MAX_TLSv1_2\", to force that specific version (and the\n> same for \"tlsv1.0\", \"tlsv1.1\", \"tlsv1.3\").\n>\n> For background: I noticed this because of this issue with debian\n> buster https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987188 . The\n> new libcurl backport enables TLS 1.3 support with gnutls, but it\n> doesn't work for certain operations, so buster applications using a\n> backported libcurl need to explicitly disable TLS 1.3 .\n\nI think you're right per the documentation, but I wonder if the current\nbehavior isn't more useful for most users. I.e. are there really users\nwho want exactly 1.2 and not 1.3, 1.4 etc. in the future that aren't\ndealing with an issue like what you're encountering?\n\nI.e. the \"better security in the future by default\" seems like a\nbetter/more common case than \"pin to this forever\" in this case, no?\n\nWe should of course have a way to pin it, but given the current behavior\nI wonder if we shouldn't just change the documentation, and introduce\nsupport for e.g. \"=tlsv1.1\" etc, or a http.pinSSLVersion=tls1.1 or\nsomething...\n\n"},{"id":"423489","messageId":"YJAEVMeY9v/j6PeS@coredump.intra.peff.net","threadId":"55611","inReplyTo":"87pmy7x6le.fsf@evledraar.gmail.com","subject":"Re: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-05-03T14:10:28Z","receivedAt":"2021-05-03T14:10:35Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 03, 2021 at 03:55:31PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> On Mon, May 03 2021, Daniel Carpenter wrote:\n> \n> > When I run: \"GIT_SSL_VERSION=tlsv1.2 GIT_CURL_VERBOSE=T git clone https://github.com/git/git.git\"\n> >\n> > I see: \"SSL connection using TLS1.3 / ECDHE_RSA_AES_128_GCM_SHA256\", but I was expecting to see \"TLS1.2\".\n> >\n> > This happens because the \"sslversions\" array (\n> > https://github.com/git/git/blob/7e391989789db82983665667013a46eabc6fc570/http.c#L58\n> > ) uses \"CURL_SSLVERSION_TLSv1_2\" which only specifies TLS 1.2 or later\n> > ( https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html ).\n> >\n> > I think configuring \"tlsv1.2\" should imply \"CURL_SSLVERSION_TLSv1_2 |\n> > CURL_SSLVERSION_MAX_TLSv1_2\", to force that specific version (and the\n> > same for \"tlsv1.0\", \"tlsv1.1\", \"tlsv1.3\").\n> >\n> > For background: I noticed this because of this issue with debian\n> > buster https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987188 . The\n> > new libcurl backport enables TLS 1.3 support with gnutls, but it\n> > doesn't work for certain operations, so buster applications using a\n> > backported libcurl need to explicitly disable TLS 1.3 .\n> \n> I think you're right per the documentation, but I wonder if the current\n> behavior isn't more useful for most users. I.e. are there really users\n> who want exactly 1.2 and not 1.3, 1.4 etc. in the future that aren't\n> dealing with an issue like what you're encountering?\n> \n> I.e. the \"better security in the future by default\" seems like a\n> better/more common case than \"pin to this forever\" in this case, no?\n> \n> We should of course have a way to pin it, but given the current behavior\n> I wonder if we shouldn't just change the documentation, and introduce\n> support for e.g. \"=tlsv1.1\" etc, or a http.pinSSLVersion=tls1.1 or\n> something...\n\nJust looking at how the curl binary does it, \"--tlsv1.2\" means \"1.2 or\ngreater\" (which is not at all surprising; the library interface tends to\nmirror their command-line and vice versa, and our behavior is influenced\nby the library interface here).  But that implies to me that curl folks\nconsidered this and though the \"or greater\" behavior was useful (which\nmakes sense -- the main goal is probably to avoid insecurities in older\nversions of the protocol).\n\nAnyway, the binary also has --tls-max for capping the maximum version.\nThat seems more flexible in general than \"use this version exactly\" (if\nyou only care that 1.3 is broken, then setting \"max=1.2\" lets you talk\nto servers that support 1.1 or 1.2).\n\n-Peff\n"},{"id":"423498","messageId":"ed63aa37ef0547bd97a5d965fb5e123f@ammonit.com","threadId":"55611","inReplyTo":"YJAEVMeY9v/j6PeS@coredump.intra.peff.net","subject":"Re: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Daniel Carpenter","fromEmail":"dc@ammonit.com","sentAt":"2021-05-03T15:02:10Z","receivedAt":"2021-05-03T15:02:15Z","isPatch":false,"sender":{"key":"dc@ammonit.com","avatar":null},"body":"> On Mon, May 03, 2021 at 03:55:31PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> > On Mon, May 03 2021, Daniel Carpenter wrote:\n> >\n> > > When I run: \"GIT_SSL_VERSION=tlsv1.2 GIT_CURL_VERBOSE=T git clone https://github.com/git/git.git\"\n> > >\n> > > I see: \"SSL connection using TLS1.3 / ECDHE_RSA_AES_128_GCM_SHA256\", but I was expecting to see \"TLS1.2\".\n> >\n> > I think you're right per the documentation, but I wonder if the current\n> > behavior isn't more useful for most users. I.e. are there really users\n> > who want exactly 1.2 and not 1.3, 1.4 etc. in the future that aren't\n> > dealing with an issue like what you're encountering?\n> >\n> > I.e. the \"better security in the future by default\" seems like a\n> > better/more common case than \"pin to this forever\" in this case, no?\n> >\n> > We should of course have a way to pin it, but given the current behavior\n> > I wonder if we shouldn't just change the documentation, and introduce\n> > support for e.g. \"=tlsv1.1\" etc, or a http.pinSSLVersion=tls1.1 or\n> > something...\n> \n> Just looking at how the curl binary does it, \"--tlsv1.2\" means \"1.2 or\n> greater\" (which is not at all surprising; the library interface tends to\n> mirror their command-line and vice versa, and our behavior is influenced\n> by the library interface here).  But that implies to me that curl folks\n> considered this and though the \"or greater\" behavior was useful (which\n> makes sense -- the main goal is probably to avoid insecurities in older\n> versions of the protocol).\n> \n> Anyway, the binary also has --tls-max for capping the maximum version.\n> That seems more flexible in general than \"use this version exactly\" (if\n> you only care that 1.3 is broken, then setting \"max=1.2\" lets you talk\n> to servers that support 1.1 or 1.2).\n> \n> -Peff\n\nI agree that the current behaviour is better for most users, and that some kind of separate \"max\" config option would work for anyone in my situation.\n\nAnother idea would be to keep the current behaviour for `http.sslVersion`, but use an exact match with the environment variable only. That already takes priority, and I imagine its main appeal over the config option is for users that want to try something with a specific TLS version.\n"},{"id":"423534","messageId":"YJBhH0eLKRSpPFy3@coredump.intra.peff.net","threadId":"55611","inReplyTo":"ed63aa37ef0547bd97a5d965fb5e123f@ammonit.com","subject":"Re: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-05-03T20:46:23Z","receivedAt":"2021-05-03T20:46:30Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 03, 2021 at 03:02:10PM +0000, Daniel Carpenter wrote:\n\n> > Just looking at how the curl binary does it, \"--tlsv1.2\" means \"1.2 or\n> > greater\" (which is not at all surprising; the library interface tends to\n> > mirror their command-line and vice versa, and our behavior is influenced\n> > by the library interface here).  But that implies to me that curl folks\n> > considered this and though the \"or greater\" behavior was useful (which\n> > makes sense -- the main goal is probably to avoid insecurities in older\n> > versions of the protocol).\n> > \n> > Anyway, the binary also has --tls-max for capping the maximum version.\n> > That seems more flexible in general than \"use this version exactly\" (if\n> > you only care that 1.3 is broken, then setting \"max=1.2\" lets you talk\n> > to servers that support 1.1 or 1.2).\n> > \n> > -Peff\n> \n> I agree that the current behaviour is better for most users, and that\n> some kind of separate \"max\" config option would work for anyone in my\n> situation.\n> \n> Another idea would be to keep the current behaviour for\n> `http.sslVersion`, but use an exact match with the environment\n> variable only. That already takes priority, and I imagine its main\n> appeal over the config option is for users that want to try something\n> with a specific TLS version.\n\nI think you're right that it may work for many people, but I'd shy away\nfrom it simply because it's subtle and hard to explain.\n\nAdding config and environment variables for \"max\" is pretty\nstraight-forward to explain. I think it would also make sense to improve\nthe documentation for http.sslVersion to make it clear that this is a\nminimum (the current wording is quite misleading).\n\n-Peff\n"},{"id":"423535","messageId":"000c01d7405f$823fd090$86bf71b0$@nexbridge.com","threadId":"55611","inReplyTo":"YJBhH0eLKRSpPFy3@coredump.intra.peff.net","subject":"RE: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2021-05-03T21:01:32Z","receivedAt":"2021-05-03T21:01:50Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On May 3, 2021 4:46 PM, Jeff King wrote:\n>On Mon, May 03, 2021 at 03:02:10PM +0000, Daniel Carpenter wrote:\n>\n>> > Just looking at how the curl binary does it, \"--tlsv1.2\" means \"1.2\n>> > or greater\" (which is not at all surprising; the library interface\n>> > tends to mirror their command-line and vice versa, and our behavior\n>> > is influenced by the library interface here).  But that implies to\n>> > me that curl folks considered this and though the \"or greater\"\n>> > behavior was useful (which makes sense -- the main goal is probably\n>> > to avoid insecurities in older versions of the protocol).\n>> >\n>> > Anyway, the binary also has --tls-max for capping the maximum version.\n>> > That seems more flexible in general than \"use this version exactly\"\n>> > (if you only care that 1.3 is broken, then setting \"max=1.2\" lets\n>> > you talk to servers that support 1.1 or 1.2).\n>> >\n>> > -Peff\n>>\n>> I agree that the current behaviour is better for most users, and that\n>> some kind of separate \"max\" config option would work for anyone in my\n>> situation.\n>>\n>> Another idea would be to keep the current behaviour for\n>> `http.sslVersion`, but use an exact match with the environment\n>> variable only. That already takes priority, and I imagine its main\n>> appeal over the config option is for users that want to try something\n>> with a specific TLS version.\n>\n>I think you're right that it may work for many people, but I'd shy away from it\n>simply because it's subtle and hard to explain.\n>\n>Adding config and environment variables for \"max\" is pretty straight-forward to\n>explain. I think it would also make sense to improve the documentation for\n>http.sslVersion to make it clear that this is a minimum (the current wording is\n>quite misleading).\n\nWhat if http.sslVersion=v1[,v2]... were supported, so there would be an enumeration of allowed versions. The benefit of an enumeration is that you could force something like 3.0-fips if your environment requires a FIPS-certified version for communication. Admittedly this is a different use case than discussed above.\n\nJust a thought.\n\nRandall\n\n"},{"id":"423536","messageId":"nycvar.QRO.7.76.2105032250540.30150@fvyyl","threadId":"55611","inReplyTo":"YJBhH0eLKRSpPFy3@coredump.intra.peff.net","subject":"Re: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Daniel Stenberg","fromEmail":"daniel@haxx.se","sentAt":"2021-05-03T20:56:54Z","receivedAt":"2021-05-03T21:05:14Z","isPatch":false,"sender":{"key":"daniel@haxx.se","avatar":"https://gravatar.com/avatar/69fdca87edd17cee21ca2e79fc2ff671d644603c3dc27167430f3cd3dbab7ba8?d=mp&s=160"},"body":"On Mon, 3 May 2021, Jeff King wrote:\n\n> I think it would also make sense to improve the documentation for \n> http.sslVersion to make it clear that this is a minimum (the current wording \n> is quite misleading).\n\nWhile improving the http.sslVersion, maybe also consider dropping the special \nmention of NSS and OpenSSL in there? Maybe just like this:\n\n         The SSL version to use when negotiating an SSL connection, if you\n         want to force the default.  The available and default version\n-       depend on whether libcurl was built against NSS or OpenSSL and the\n-       particular configuration of the crypto library in use. Internally\n+       depend on which TLS library libcurl was built to use. Internally\n         this sets the 'CURLOPT_SSL_VERSION' option; see the libcurl\n         documentation for more details on the format of this option and\n         for the ssl version supported. Currently the possible values of\n\nMaybe also consider dropping 'sslv2' and 'sslv3' from the docs now since \nvirtually no TLS library supports them since several years now (as they're \nconsidered insecure and bad) and therefor asking curl to use those will more \noften than not rather cause an error.\n\n-- \n\n  / daniel.haxx.se\n"},{"id":"423537","messageId":"nycvar.QRO.7.76.2105032306580.30150@fvyyl","threadId":"55611","inReplyTo":"000c01d7405f$823fd090$86bf71b0$@nexbridge.com","subject":"RE: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Daniel Stenberg","fromEmail":"daniel@haxx.se","sentAt":"2021-05-03T21:09:47Z","receivedAt":"2021-05-03T21:09:50Z","isPatch":false,"sender":{"key":"daniel@haxx.se","avatar":"https://gravatar.com/avatar/69fdca87edd17cee21ca2e79fc2ff671d644603c3dc27167430f3cd3dbab7ba8?d=mp&s=160"},"body":"On Mon, 3 May 2021, Randall S. Becker wrote:\n\n> What if http.sslVersion=v1[,v2]... were supported, so there would be an \n> enumeration of allowed versions.\n\nThat doesn't map very well to the options libcurl provide.\n\n> The benefit of an enumeration is that you could force something like \n> 3.0-fips if your environment requires a FIPS-certified version for \n> communication. Admittedly this is a different use case than discussed above.\n\nYes, and as \"3.0-fips\" is not a TLS version at all I think it would complicate \nmatters in a wrong direction.\n\nYou can build libcurl to use use a FIPS compatible crypto library today, but \nif you do then you still select TLS version using the same options like \nbefore.\n\n-- \n\n  / daniel.haxx.se\n"},{"id":"423539","messageId":"000d01d74062$95cf6a50$c16e3ef0$@nexbridge.com","threadId":"55611","inReplyTo":"nycvar.QRO.7.76.2105032306580.30150@fvyyl","subject":"RE: http.sslVersion only specifies minimum TLS version, later versions are allowed","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2021-05-03T21:23:33Z","receivedAt":"2021-05-03T21:23:56Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On May 3, 2021 5:10 PM, Daniel Stenberg wrote:\n>Subject: RE: http.sslVersion only specifies minimum TLS version, later\nversions\n>are allowed\n>\n>On Mon, 3 May 2021, Randall S. Becker wrote:\n>\n>> What if http.sslVersion=v1[,v2]... were supported, so there would be\n>> an enumeration of allowed versions.\n>\n>That doesn't map very well to the options libcurl provide.\n>\n>> The benefit of an enumeration is that you could force something like\n>> 3.0-fips if your environment requires a FIPS-certified version for\n>> communication. Admittedly this is a different use case than discussed\nabove.\n>\n>Yes, and as \"3.0-fips\" is not a TLS version at all I think it would\ncomplicate\n>matters in a wrong direction.\n>\n>You can build libcurl to use use a FIPS compatible crypto library today,\nbut if you\n>do then you still select TLS version using the same options like before.\n\nSadly, curl_version_info_data.ssl_version does not provide this level of\ndetail. Maybe it should, but I'm not about to go there.\n\nRegards,\nRandall\n\n"}]}