Ensure TLS 1.3 works with GnuTLS#5223
Ensure TLS 1.3 works with GnuTLS#5223dbussink wants to merge 1 commit intocurl:masterfrom dbussink:fix-gnutls-tls13
Conversation
When SRP is requested in the priority string, GnuTLS will disable support for TLS 1.3. Before this change, curl would always add +SRP to the priority list, effectively always disabling TLS 1.3 support. With this change, +SRP is only added to the priority list when SRP authentication is also requested. This also allows updating the error handling here to not have to retry without SRP. This is because SRP is only added when requested and in that case a retry is not needed.
dbussink
left a comment
There was a problem hiding this comment.
I originally discovered this problem while trying to debug why git on the upcoming Ubuntu 20.04 release was only connecting over TLS 1.2 to GitHub.com, even though GitHub.com supports TLS 1.3.
Ubuntu compiles with OpenSSL normally for the command line curl where TLS 1.3 worked fine, but it didn't for the GnuTLS library version that is also provided and used by git.
| free(prioritysrp); | ||
|
|
||
| if((rc == GNUTLS_E_INVALID_REQUEST) && err) { | ||
| infof(data, "This GnuTLS does not support SRP\n"); |
There was a problem hiding this comment.
I've kept this message here so it's shown in the same circumstances, but now only when SRP is explicitly requested.
|
Running this locally against a TLS 1.3 only site:
|
|
Missed adding a link to the GnuTLS documentation where it's stated that requesting SRP will disable TLS 1.3: https://www.gnutls.org/manual/gnutls.html#Authentication-using-SRP |
|
Thanks! |
Building using cmake got issue in testing: [043] box-tap/curlgh-5223-curl-exports.test.lua [ fail ] [043] Test failed! Output from reject file box-tap/curlgh-5223-curl-exports.reject: [043] [043] Last 15 lines of Tarantool Log file [Instance "app_server"][/build/usr/src/debug/tarantool-2.6.0.54/test/var/043_box-tap/curlgh-5223-curl-exports.test.lua.tarantool.log]: [043] LuajitError: ...tool-2.6.0.54/test/box-tap/curlgh-5223-curl-exports.test.lua:57: tarantool: undefined symbol: curl_version_info It happened because curl used visibility hiding mode for its symbols and the test could not use it. To fix it symbols hiding disabled for gcc and clang. Closes tarantool/tarantool#5268
When SRP is requested in the priority string, GnuTLS will disable support for TLS 1.3. Before this change, curl would always add +SRP to the priority list, effectively always disabling TLS 1.3 support.
With this change, +SRP is only added to the priority list when SRP authentication is also requested. This also allows updating the error handling here to not have to retry without SRP. This is because SRP is only added when requested and in that case a retry is not needed.