-
Notifications
You must be signed in to change notification settings - Fork 851
Fix autest compatibility with Fedora 43 / Python 3.14 #12857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0b4324a
7a82213
185f8ab
c0d0b29
9b0c9a4
20a8baf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import os | ||
| import subprocess | ||
| import json | ||
| import re | ||
|
|
@@ -51,6 +52,57 @@ def IsOpenSSL(self): | |
| "SSL library is not OpenSSL") | ||
|
|
||
|
|
||
| def HasLegacyTLSSupport(self): | ||
| """Check if the system supports legacy TLS protocols (TLSv1.0 and TLSv1.1). | ||
|
|
||
| Modern OpenSSL 3.x installations often disable these protocols entirely, | ||
| even if the openssl binary still accepts the -tls1 flag and lists TLSv1 ciphers. | ||
|
|
||
| On Fedora/RHEL systems, the crypto-policies framework may disable legacy | ||
| TLS at runtime even when OpenSSL is compiled with support for it. This | ||
| causes 'openssl ciphers -v -tls1' to still list TLSv1 ciphers, but actual | ||
| TLS 1.0 connections will fail with "no protocols available". | ||
|
|
||
| We only probe TLSv1.0 (not TLSv1.1 separately) because crypto-policies | ||
| always disable both legacy versions together. If TLSv1.0 is unavailable, | ||
| TLSv1.1 will be too. | ||
|
|
||
| The check connects to localhost on a closed port to avoid any external | ||
| network dependency. A "connection refused" error means the TLS protocol | ||
| was available but nothing was listening; "no protocols available" means | ||
| the crypto-policy blocked TLSv1.0 entirely. | ||
| """ | ||
|
|
||
| def check_tls1_support(): | ||
| try: | ||
| # Connect to localhost on a port nothing is listening on. | ||
| # This avoids external network dependency while still detecting | ||
| # whether the crypto-policy allows TLSv1.0. | ||
| result = subprocess.run( | ||
| ['openssl', 's_client', '-tls1', '-connect', '127.0.0.1:1'], | ||
| capture_output=True, | ||
| text=True, | ||
| timeout=5, | ||
| input='' # Don't wait for interactive input | ||
| ) | ||
| output = result.stdout + result.stderr | ||
| # "no protocols available" means TLSv1 is disabled by crypto-policy | ||
| if 'no protocols available' in output: | ||
| return False | ||
| # Connection refused or other errors mean TLSv1 was attempted | ||
| # (the protocol is available, just no server listening) | ||
| return True | ||
| except subprocess.TimeoutExpired: | ||
| # Timeout on localhost shouldn't happen, but if it does, | ||
| # assume TLSv1 is not available (safer than false positive) | ||
| return False | ||
| except Exception: | ||
| # If we can't determine, assume TLSv1 is not available (safer) | ||
| return False | ||
|
Comment on lines
55
to
101
|
||
|
|
||
| return self.Condition(check_tls1_support, "System does not support legacy TLS protocols (TLSv1.0/TLSv1.1)") | ||
|
|
||
|
|
||
| def HasCurlVersion(self, version): | ||
| return self.EnsureVersion(["curl", "--version"], min_version=version) | ||
|
|
||
|
|
@@ -118,6 +170,7 @@ ExtendCondition(HasOpenSSLVersion) | |
| ExtendCondition(HasProxyVerifierVersion) | ||
| ExtendCondition(IsBoringSSL) | ||
| ExtendCondition(IsOpenSSL) | ||
| ExtendCondition(HasLegacyTLSSupport) | ||
| ExtendCondition(HasATSFeature) | ||
| ExtendCondition(HasCurlVersion) | ||
| ExtendCondition(HasCurlFeature) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition claims to check TLSv1.0 and TLSv1.1 support, but it only probes
-tls1. Either also probe-tls1_1(and require both, if that’s what the tests need) or rename/update the messaging so it matches what is actually being detected.