@@ -66,7 +66,7 @@ index b5c78a5..41235c1 100644
66
66
client = self.imap_class(*server.server_address,
67
67
ssl_context=ssl_context)
68
68
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
69
- index a1a581a..c69e711 100644
69
+ index a1a581a..6f42437 100644
70
70
--- a/Lib/test/test_ssl.py
71
71
+++ b/Lib/test/test_ssl.py
72
72
@@ -44,6 +44,7 @@
@@ -253,19 +253,16 @@ index a1a581a..c69e711 100644
253
253
254
254
def test_version_basic(self):
255
255
"""
256
- @@ -4004,7 +4016,10 @@ def test_min_max_version_mismatch(self):
256
+ @@ -4004,7 +4016,7 @@ def test_min_max_version_mismatch(self):
257
257
server_hostname=hostname) as s:
258
258
with self.assertRaises(ssl.SSLError) as e:
259
259
s.connect((HOST, server.port))
260
260
- self.assertIn("alert", str(e.exception))
261
- + self.assertTrue(
262
- + "alert"in str(e.exception)
263
- + or "ALERT"in str(e.exception)
264
- + )
261
+ + self.assertRegex(str(e.exception), "(alert|ALERT)")
265
262
266
263
@requires_tls_version('SSLv3')
267
264
def test_min_max_version_sslv3(self):
268
- @@ -4046,6 +4061 ,9 @@ def test_tls_unique_channel_binding(self):
265
+ @@ -4046,6 +4058 ,9 @@ def test_tls_unique_channel_binding(self):
269
266
270
267
client_context, server_context, hostname = testing_context()
271
268
@@ -275,15 +272,15 @@ index a1a581a..c69e711 100644
275
272
server = ThreadedEchoServer(context=server_context,
276
273
chatty=True,
277
274
connectionchatty=False)
278
- @@ -4118,6 +4136 ,7 @@ def test_compression_disabled(self):
275
+ @@ -4118,6 +4133 ,7 @@ def test_compression_disabled(self):
279
276
self.assertIs(stats['compression'], None)
280
277
281
278
@unittest.skipIf(Py_DEBUG_WIN32, "Avoid mixing debug/release CRT on Windows")
282
279
+ @unittest.skipIf(Py_OPENSSL_IS_AWSLC, "AWS-LC doesn't support (FF)DHE")
283
280
def test_dh_params(self):
284
281
# Check we can get a connection with ephemeral Diffie-Hellman
285
282
client_context, server_context, hostname = testing_context()
286
- @@ -4132,7 +4151 ,7 @@ def test_dh_params(self):
283
+ @@ -4132,7 +4148 ,7 @@ def test_dh_params(self):
287
284
cipher = stats["cipher"][0]
288
285
parts = cipher.split("-")
289
286
if "ADH" not in parts and "EDH" not in parts and "DHE" not in parts:
@@ -292,7 +289,7 @@ index a1a581a..c69e711 100644
292
289
293
290
def test_ecdh_curve(self):
294
291
# server secp384r1, client auto
295
- @@ -4299,8 +4318 ,10 @@ def cb_raising(ssl_sock, server_name, initial_context):
292
+ @@ -4299,8 +4315 ,10 @@ def cb_raising(ssl_sock, server_name, initial_context):
296
293
chatty=False,
297
294
sni_name='supermessage')
298
295
@@ -305,7 +302,7 @@ index a1a581a..c69e711 100644
305
302
self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
306
303
307
304
def test_sni_callback_wrong_return_type(self):
308
- @@ -4476,7 +4497 ,10 @@ def test_session_handling(self):
305
+ @@ -4476,7 +4494 ,10 @@ def test_session_handling(self):
309
306
'Session refers to a different SSLContext.')
310
307
311
308
@@ -317,7 +314,7 @@ index a1a581a..c69e711 100644
317
314
class TestPostHandshakeAuth(unittest.TestCase):
318
315
def test_pha_setter(self):
319
316
protocols = [
320
- @@ -4752,6 +4776 ,31 @@ def test_internal_chain_server(self):
317
+ @@ -4752,6 +4773 ,31 @@ def test_internal_chain_server(self):
321
318
self.assertEqual(res, b'\x02\n')
322
319
323
320
@@ -350,7 +347,7 @@ index a1a581a..c69e711 100644
350
347
requires_keylog = unittest.skipUnless(
351
348
HAS_KEYLOG, 'test requires OpenSSL 1.1.1 with keylog callback')
352
349
diff --git a/Modules/Setup b/Modules/Setup
353
- index 87c6a15..f67d7ec 100644
350
+ index 87c6a15..1a7257c 100644
354
351
--- a/Modules/Setup
355
352
+++ b/Modules/Setup
356
353
@@ -208,8 +208,8 @@ _symtable symtablemodule.c
@@ -403,7 +400,7 @@ index 35addf4..77a12c6 100644
403
400
};
404
401
405
402
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
406
- index 7a28f2d..b0d2ea1 100644
403
+ index e637830..dc99dd8 100644
407
404
--- a/Modules/_ssl.c
408
405
+++ b/Modules/_ssl.c
409
406
@@ -181,6 +181,12 @@ extern const SSL_METHOD *TLSv1_2_method(void);
@@ -454,7 +451,7 @@ index 7a28f2d..b0d2ea1 100644
454
451
if (ret < 1)
455
452
return PySSL_SetError(self, ret, __FILE__, __LINE__);
456
453
if (PySSL_ChainExceptions(self) < 0)
457
- @@ -2771,7 +2783 ,7 @@ static PyObject *
454
+ @@ -2771,7 +2778 ,7 @@ static PyObject *
458
455
_ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self)
459
456
/*[clinic end generated code: output=532147f3b1341425 input=6bfa874810a3d889]*/
460
457
{
@@ -463,7 +460,7 @@ index 7a28f2d..b0d2ea1 100644
463
460
int err = SSL_verify_client_post_handshake(self->ssl);
464
461
if (err == 0)
465
462
return _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__);
466
- @@ -3199,7 +3211 ,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
463
+ @@ -3199,7 +3206 ,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
467
464
X509_VERIFY_PARAM_set_flags(params, X509_V_FLAG_TRUSTED_FIRST);
468
465
X509_VERIFY_PARAM_set_hostflags(params, self->hostflags);
469
466
@@ -472,7 +469,7 @@ index 7a28f2d..b0d2ea1 100644
472
469
self->post_handshake_auth = 0;
473
470
SSL_CTX_set_post_handshake_auth(self->ctx, self->post_handshake_auth);
474
471
#endif
475
- @@ -3573,7 +3585 ,7 @@ set_maximum_version(PySSLContext *self, PyObject *arg, void *c)
472
+ @@ -3573,7 +3580 ,7 @@ set_maximum_version(PySSLContext *self, PyObject *arg, void *c)
476
473
return set_min_max_proto_version(self, arg, 1);
477
474
}
478
475
@@ -481,7 +478,7 @@ index 7a28f2d..b0d2ea1 100644
481
478
static PyObject *
482
479
get_num_tickets(PySSLContext *self, void *c)
483
480
{
484
- @@ -3604,7 +3616 ,7 @@ set_num_tickets(PySSLContext *self, PyObject *arg, void *c)
481
+ @@ -3604,7 +3611 ,7 @@ set_num_tickets(PySSLContext *self, PyObject *arg, void *c)
485
482
486
483
PyDoc_STRVAR(PySSLContext_num_tickets_doc,
487
484
"Control the number of TLSv1.3 session tickets");
@@ -490,7 +487,7 @@ index 7a28f2d..b0d2ea1 100644
490
487
491
488
static PyObject *
492
489
get_security_level(PySSLContext *self, void *c)
493
- @@ -3694,14 +3706 ,14 @@ set_check_hostname(PySSLContext *self, PyObject *arg, void *c)
490
+ @@ -3694,14 +3701 ,14 @@ set_check_hostname(PySSLContext *self, PyObject *arg, void *c)
494
491
495
492
static PyObject *
496
493
get_post_handshake_auth(PySSLContext *self, void *c) {
@@ -507,7 +504,7 @@ index 7a28f2d..b0d2ea1 100644
507
504
static int
508
505
set_post_handshake_auth(PySSLContext *self, PyObject *arg, void *c) {
509
506
if (arg == NULL) {
510
- @@ -4651 ,14 +4663 ,14 @@ static PyGetSetDef context_getsetlist[] = {
507
+ @@ -4706 ,14 +4713 ,14 @@ static PyGetSetDef context_getsetlist[] = {
511
508
(setter) _PySSLContext_set_msg_callback, NULL},
512
509
{"sni_callback", (getter) get_sni_callback,
513
510
(setter) set_sni_callback, PySSLContext_sni_callback_doc},
0 commit comments