Repository navigation
Don't ignore SSLOptions when GNU TLS has no SYSTEM priority - #234
Merged
Merged
Conversation
The priority string started with "@System,", which GNU TLS only accepts when its configuration file defines a SYSTEM priority. Debian and Ubuntu do not, so the whole string was rejected, the error was ignored, and the session kept the default priorities - every SSLOptions setting (MinTLS, MaxTLS, DenyCBC, ...) was silently dropped. Mirror the fix from CUPS (OpenPrinting/cups#1677, #1701): probe "@System" before using it, and fail the connection if the priorities cannot be set.
Port test/testssloptions.py from CUPS (OpenPrinting/cups#1701) to the libcups 3 API. It builds a small client with the flags from Makedefs, runs it against local Python TLS servers with and without a SYSTEM priority, and checks that the SSLOptions in client.conf are honored. Like in CUPS it is only run by the GNU TLS job in build.yml, so the build system does not depend on Python.
michaelrsweet
requested changes
Nov 25, 2026
michaelrsweet
left a comment
Member
There was a problem hiding this comment.
Please remove the python tests. Python isn't particularly portable and I have no desire to maintain such a test framework going forward.
The tls-gnutls.c changes are fine.
Python isn't portable enough for the libcups test suite.
Contributor
Author
|
Thanks, I've removed the Python test and the CI step. The PR now only changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #232 as requested.
_httpTLSStartbuilds the GNU TLS priority string as@SYSTEM,NORMAL:.... GNU TLS only accepts@SYSTEMwhen its configuration file defines aSYSTEMpriority, and Debian and Ubuntu don't define one. The whole string is rejected, the return value is ignored, and the session keeps the defaults fromgnutls_set_default_priority. So everySSLOptionssetting (MinTLS*,MaxTLS*,DenyCBC, ...) is silently dropped.This is the same bug as OpenPrinting/cups#1677, which was fixed in CUPS by OpenPrinting/cups#1701. This PR mirrors that fix:
@SYSTEMfirst and only prepend it when it is available (both thegnutls_priority_set_directandgnutls_priority_initcode paths).The C change is identical to the CUPS one.
Tested on Ubuntu 26.04 (GNU TLS 3.8.12, stock
/etc/gnutls/config, no[priorities]), built with the CI flags (--enable-debug --enable-maintainer --with-tls=gnutls --with-sanitizer=address):tlscheck --tls12against a server that offers TLS 1.3: master connects with TLS/1.3; with this PR it connects with TLS/1.2.testssloptions.pyfrom Fix ignored GnuTLS options when SYSTEM priorities are unavailable cups#1701: 3 failures on master (MaxTLS1.2gives TLS 1.3, a TLS 1.3-only server is accepted,MinTLS1.3accepts TLS 1.2). 8/8 pass with this PR, using bothgnutls_priority_set_directand thegnutls_priority_initfallback (built withHAVE_GNUTLS_PRIORITY_SET_DIRECTundefined).make testpasses.