author | Alberto Bertogli
<albertito@blitiri.com.ar> 2024-08-10 16:17:45 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2024-08-10 16:17:45 UTC |
parent | d8ed805afe4150b74697c67682a0390dd8317e95 |
tests/run_tests | +4 | -5 |
diff --git a/tests/run_tests b/tests/run_tests index 8c8f84d..1782cc2 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -395,11 +395,10 @@ class TrickyRequests(TestCase): def test_server_cert(self): rawsock = socket.create_connection(("localhost", 19840)) - sock = ssl.wrap_socket( - rawsock, - keyfile=self.client.key_path(), - certfile=self.client.cert_path(), - ) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + context.load_verify_locations(self.server.cert_path()) + context.check_hostname = False + sock = context.wrap_socket(rawsock) # We don't check the cipher itself, as it depends on the environment, # but we should be using >= 128 bit secrets.