|
1 |
| -diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py |
2 |
| -index 6e63a88..7dc83d7 100644 |
3 |
| ---- a/Lib/test/test_httplib.py |
4 |
| -+++ b/Lib/test/test_httplib.py |
5 |
| -@@ -2066,7 +2066,7 @@ def test_host_port(self): |
6 |
| - |
7 |
| - def test_tls13_pha(self): |
8 |
| - import ssl |
9 |
| -- if not ssl.HAS_TLSv1_3: |
10 |
| -+ if not ssl.HAS_TLSv1_3 or "AWS-LC" in ssl.OPENSSL_VERSION: |
11 |
| - self.skipTest('TLS 1.3 support required') |
12 |
| - # just check status of PHA flag |
13 |
| - h = client.HTTPSConnection('localhost', 443) |
14 | 1 | diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
|
15 | 2 | index 0e50d09..f4b7b3c 100644
|
16 | 3 | --- a/Lib/test/test_ssl.py
|
17 | 4 | +++ b/Lib/test/test_ssl.py
|
18 |
| -@@ -41,6 +41,7 @@ |
19 |
| - from ssl import Purpose, TLSVersion, _TLSContentType, _TLSMessageType, _TLSAlertType |
20 |
| - |
21 |
| - Py_DEBUG_WIN32 = support.Py_DEBUG and sys.platform == 'win32' |
22 |
| -+Py_OPENSSL_IS_AWSLC = "AWS-LC" in ssl.OPENSSL_VERSION |
23 |
| - |
24 |
| - PROTOCOLS = sorted(ssl._PROTOCOL_NAMES) |
25 |
| - HOST = socket_helper.HOST |
26 |
| -@@ -174,7 +175,7 @@ def is_ubuntu(): |
27 |
| - except FileNotFoundError: |
28 |
| - return False |
29 |
| - |
30 |
| --if is_ubuntu(): |
31 |
| -+if is_ubuntu() and not Py_OPENSSL_IS_AWSLC: |
32 |
| - def seclevel_workaround(*ctxs): |
33 |
| - """"Lower security level to '1' and allow all ciphers for TLS 1.0/1""" |
34 |
| - for ctx in ctxs: |
35 |
| -@@ -4001,6 +4002,7 @@ def test_no_legacy_server_connect(self): |
| 5 | +@@ -4034,6 +4034,7 @@ def test_no_legacy_server_connect(self): |
36 | 6 | sni_name=hostname)
|
37 |
| - |
| 7 | + |
38 | 8 | @unittest.skipIf(Py_DEBUG_WIN32, "Avoid mixing debug/release CRT on Windows")
|
39 |
| -+ @unittest.skipIf(Py_OPENSSL_IS_AWSLC, "AWS-LC doesn't support (FF)DHE") |
| 9 | ++ @unittest.skipIf("AWS-LC" in ssl.OPENSSL_VERSION, "AWS-LC doesn't support") |
40 | 10 | def test_dh_params(self):
|
41 | 11 | # Check we can get a connection with ephemeral Diffie-Hellman
|
42 | 12 | client_context, server_context, hostname = testing_context()
|
@@ -74,50 +44,6 @@ index 0e50d09..f4b7b3c 100644
|
74 | 44 | server_context.minimum_version = ssl.TLSVersion.TLSv1_3
|
75 | 45 | server_context.set_ciphers('PSK')
|
76 | 46 | server_context.set_psk_server_callback(server_callback, identity_hint)
|
77 |
| -@@ -4461,7 +4463,10 @@ def server_callback(identity): |
78 |
| - s.connect((HOST, server.port)) |
79 |
| - |
80 |
| - |
81 |
| --@unittest.skipUnless(has_tls_version('TLSv1_3'), "Test needs TLS 1.3") |
82 |
| -+@unittest.skipUnless( |
83 |
| -+ has_tls_version('TLSv1_3') and not Py_OPENSSL_IS_AWSLC, |
84 |
| -+ "Test needs TLS 1.3; AWS-LC doesn't support PHA" |
85 |
| -+) |
86 |
| - class TestPostHandshakeAuth(unittest.TestCase): |
87 |
| - def test_pha_setter(self): |
88 |
| - protocols = [ |
89 |
| -@@ -4737,6 +4742,31 @@ def test_internal_chain_server(self): |
90 |
| - self.assertEqual(res, b'\x02\n') |
91 |
| - |
92 |
| - |
93 |
| -+@unittest.skipUnless(Py_OPENSSL_IS_AWSLC, "Only test this against AWS-LC") |
94 |
| -+class TestPostHandshakeAuthAwsLc(unittest.TestCase): |
95 |
| -+ def test_pha(self): |
96 |
| -+ protocols = [ |
97 |
| -+ ssl.PROTOCOL_TLS_SERVER, ssl.PROTOCOL_TLS_CLIENT |
98 |
| -+ ] |
99 |
| -+ for protocol in protocols: |
100 |
| -+ client_ctx, server_ctx, hostname = testing_context() |
101 |
| -+ client_ctx.load_cert_chain(SIGNED_CERTFILE) |
102 |
| -+ self.assertEqual(client_ctx.post_handshake_auth, None) |
103 |
| -+ with self.assertRaises(AttributeError): |
104 |
| -+ client_ctx.post_handshake_auth = True |
105 |
| -+ with self.assertRaises(AttributeError): |
106 |
| -+ server_ctx.post_handshake_auth = True |
107 |
| -+ |
108 |
| -+ with ThreadedEchoServer(context=server_ctx) as server: |
109 |
| -+ with client_ctx.wrap_socket( |
110 |
| -+ socket.socket(), |
111 |
| -+ server_hostname=hostname |
112 |
| -+ ) as ssock: |
113 |
| -+ ssock.connect((HOST, server.port)) |
114 |
| -+ with self.assertRaises(NotImplementedError): |
115 |
| -+ ssock.verify_client_post_handshake() |
116 |
| -+ |
117 |
| -+ |
118 |
| - HAS_KEYLOG = hasattr(ssl.SSLContext, 'keylog_filename') |
119 |
| - requires_keylog = unittest.skipUnless( |
120 |
| - HAS_KEYLOG, 'test requires OpenSSL 1.1.1 with keylog callback') |
121 | 47 | diff --git a/Modules/Setup b/Modules/Setup
|
122 | 48 | index cd1cf24..53bcc4c 100644
|
123 | 49 | --- a/Modules/Setup
|
|
0 commit comments