From: Bob Halley Date: Thu, 17 Feb 2022 16:29:52 +0000 (-0800) Subject: fix test TLS alert X-Git-Tag: v2.3.0rc1~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb6b5ccbac63776a1f53cb0d62cda7afb60f97d3;p=thirdparty%2Fdnspython.git fix test TLS alert --- diff --git a/tests/test_query.py b/tests/test_query.py index 48c8b841..2d954e36 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -151,6 +151,10 @@ class QueryTests(unittest.TestCase): base_s.settimeout(2) base_s.connect(ll) ctx = ssl.create_default_context() + if sys.version_info >= (3, 7): + ctx.minimum_version = ssl.TLSVersion.TLSv1_2 + else: + ctx.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 with ctx.wrap_socket(base_s, server_hostname='dns.google') as s: # lgtm[py/insecure-protocol] s.setblocking(0) qname = dns.name.from_text('dns.google.')