MCPcopy Index your code
hub / github.com/python/cpython / test_groups

Method test_groups

Lib/test/test_ssl.py:4439–4469  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4437 sni_name=hostname)
4438
4439 def test_groups(self):
4440 # server secp384r1, client auto
4441 client_context, server_context, hostname = testing_context()
4442
4443 server_context.set_groups("secp384r1")
4444 server_context.minimum_version = ssl.TLSVersion.TLSv1_3
4445 stats = server_params_test(client_context, server_context,
4446 chatty=True, connectionchatty=True,
4447 sni_name=hostname)
4448 if CAN_GET_SELECTED_OPENSSL_GROUP:
4449 self.assertEqual(stats['group'], "secp384r1")
4450
4451 # server auto, client secp384r1
4452 client_context, server_context, hostname = testing_context()
4453 client_context.set_groups("secp384r1")
4454 server_context.minimum_version = ssl.TLSVersion.TLSv1_3
4455 stats = server_params_test(client_context, server_context,
4456 chatty=True, connectionchatty=True,
4457 sni_name=hostname)
4458 if CAN_GET_SELECTED_OPENSSL_GROUP:
4459 self.assertEqual(stats['group'], "secp384r1")
4460
4461 # server / client curve mismatch
4462 client_context, server_context, hostname = testing_context()
4463 client_context.set_groups("prime256v1")
4464 server_context.set_groups("secp384r1")
4465 server_context.minimum_version = ssl.TLSVersion.TLSv1_3
4466 with self.assertRaises(ssl.SSLError):
4467 server_params_test(client_context, server_context,
4468 chatty=True, connectionchatty=True,
4469 sni_name=hostname)
4470
4471 @unittest.skipUnless(CAN_SET_CLIENT_SIGALGS,
4472 "SSL library doesn't support setting client sigalgs")

Callers

nothing calls this directly

Calls 4

testing_contextFunction · 0.85
server_params_testFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected