(self)
| 4096 | sni_name=hostname) |
| 4097 | |
| 4098 | def test_dh_params(self): |
| 4099 | # Check we can get a connection with ephemeral finite-field |
| 4100 | # Diffie-Hellman (if supported). |
| 4101 | client_context, server_context, hostname = testing_context() |
| 4102 | dhe_aliases = {"ADH", "EDH", "DHE"} |
| 4103 | if not (supports_kx_alias(client_context, dhe_aliases) |
| 4104 | and supports_kx_alias(server_context, dhe_aliases)): |
| 4105 | self.skipTest("libssl doesn't support ephemeral DH") |
| 4106 | # test scenario needs TLS <= 1.2 |
| 4107 | client_context.maximum_version = ssl.TLSVersion.TLSv1_2 |
| 4108 | try: |
| 4109 | server_context.load_dh_params(DHFILE) |
| 4110 | except RuntimeError: |
| 4111 | if Py_DEBUG_WIN32: |
| 4112 | self.skipTest("not supported on Win32 debug build") |
| 4113 | raise |
| 4114 | server_context.set_ciphers("kEDH") |
| 4115 | server_context.maximum_version = ssl.TLSVersion.TLSv1_2 |
| 4116 | stats = server_params_test(client_context, server_context, |
| 4117 | chatty=True, connectionchatty=True, |
| 4118 | sni_name=hostname) |
| 4119 | cipher = stats["cipher"][0] |
| 4120 | parts = cipher.split("-") |
| 4121 | if not dhe_aliases.intersection(parts): |
| 4122 | self.fail("Non-DH key exchange: " + cipher[0]) |
| 4123 | |
| 4124 | def test_ecdh_curve(self): |
| 4125 | # server secp384r1, client auto |
nothing calls this directly
no test coverage detected