summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorGrant Ramsay <grant.ramsay@hotmail.com>2023-11-29 00:15:39 (GMT)
committerGitHub <noreply@github.com>2023-11-29 00:15:39 (GMT)
commite413daf5f6b983bdb4e1965d76b5313cb93b266e (patch)
tree1a6e410e4c910cf75e2016a687668bc4da8843d4 /Lib/test/test_ssl.py
parent48dfd74a9db9d4aa9c6f23b4a67b461e5d977173 (diff)
downloadcpython-e413daf5f6b983bdb4e1965d76b5313cb93b266e.zip
cpython-e413daf5f6b983bdb4e1965d76b5313cb93b266e.tar.gz
cpython-e413daf5f6b983bdb4e1965d76b5313cb93b266e.tar.bz2
gh-112454: Disable TLS-PSK if OpenSSL was built without PSK support (#112491)
If OpenSSL was built without PSK support, the python TLS-PSK methods will raise "NotImplementedError" if called. Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index aecba89..3fdfa29 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -4259,6 +4259,7 @@ class ThreadedTests(unittest.TestCase):
'Session refers to a different SSLContext.')
@requires_tls_version('TLSv1_2')
+ @unittest.skipUnless(ssl.HAS_PSK, 'TLS-PSK disabled on this OpenSSL build')
def test_psk(self):
psk = bytes.fromhex('deadbeef')
@@ -4326,6 +4327,7 @@ class ThreadedTests(unittest.TestCase):
s.connect((HOST, server.port))
@requires_tls_version('TLSv1_3')
+ @unittest.skipUnless(ssl.HAS_PSK, 'TLS-PSK disabled on this OpenSSL build')
def test_psk_tls1_3(self):
psk = bytes.fromhex('deadbeef')
identity_hint = 'identity-hint'