File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1393,6 +1393,16 @@ def test_subclass(self):
1393
1393
# For compatibility
1394
1394
self .assertEqual (cm .exception .errno , ssl .SSL_ERROR_WANT_READ )
1395
1395
1396
+ def test_bad_idna_in_server_hostname (self ):
1397
+ # Note: this test is testing some code that probably shouldn't exist
1398
+ # in the first place, so if it starts failing at some point because
1399
+ # you made the ssl module stop doing IDNA decoding then please feel
1400
+ # free to remove it. The test was mainly added because this case used
1401
+ # to cause memory corruption (see bpo-30594).
1402
+ ctx = ssl .create_default_context ()
1403
+ with self .assertRaises (UnicodeError ):
1404
+ ctx .wrap_bio (ssl .MemoryBIO (), ssl .MemoryBIO (),
1405
+ server_hostname = "xn--.com" )
1396
1406
1397
1407
class MemoryBIOTests (unittest .TestCase ):
1398
1408
You can’t perform that action at this time.
0 commit comments